VisiGenie userled0

I am using an Arduino Uno with a uLCD32-PTu and a 4 channel relay board. I am familiar with using the 4D workshop program’s VisiGenie with the example code to create basic user interfaces for gauges, ledDigits and other forms of data display, but I have no way of telling if any of my 4 channel relays are off or on unless I look at the onboard LEDs or listen for a click.

Can someone provide me with an example program that shows an on screen “userled0” turning off and on (HIGH and LOW) as the relay is commanded to go HIGH and LOW?

THIS IS ONLY AN EXAMPLE CODE: I setup the useled0 as if it could be controlled like a relay to show what I’m trying to do, however I do not think this is correct coding and I need an example of how to correctly make this logic happen…

if ( (slider1_val <= 0) || ( sensor1 < slider1_val  ) )
{
    if  ( sensor1 < waterOut )  
   {
       digitalWrite(CHANNEL2, HIGH); //VALVE OPEN
       digitalWrite(userled0, HIGH); //TURN ON SCREEN LED ON TO SHOW THAT RELAY IS ON

  
  }
    else
    {
       digitalWrite(CHANNEL2, LOW); //VALVE CLOSED
       digitalWrite(userled0, LOW); //TURN ON SCREEN LED OFF TO SHOW THAT RELAY IS OFF

     }
}
else
{
         digitalWrite(CHANNEL2, HIGH); //VALVE OPEN

}
else
{
         digitalWrite(CHANNEL2, HIGH); //VALVE OPEN

}

Shouldn't you be doing something with the LED here ?

Good catch, but I was just using that example code to describe what I'm trying to do. I imagine the userled0 on the touchscreen display is controlled differently than an actual stand alone LED on it's own individual I/O pin. You know what I mean?