OK guys how do I make a indicator flash is a flag is 1 and not 0?
I can do it with a tag in the PLC but I would like to have a cleaner way to do it. I am sure there is a simple way to do this.
Note: This example was created by first setting up the Tag Format as Two-State and assigning Text for the On State and Off State, and setting up the default colors for the tag.
Then I just drag and drop it on screen, bump the font size around and align it, then drill into the tag settings. On the Data Tab, I check all the Get From Tag options.
Are you wanting to flash an indicator from the Primitives menu?
I have done this before but that was in C2 in fact I think found a example of how to do this on RedLions website they have some samples you can download
You pointed me in the right direction. I used 2 images.
1st was the image off state image of an indicator. 2nd was the on state with a little bit of code "if (Tag1)return Flash(2);"
So when my E-Stop is not active I get the first image. When it is active I get the first and second alternating. Is there a better way to do this?
I know this is old, but it came up when I was looking to do this. The way I was able to pull this off was to just use the system clock with Complex Code.
If you use "return GetSec(GetNow())%2;" and put your tag in there then it will blink once a second to the system clock. From there you could include the original indicator to get something like "return GetSec(GetNow())%2&&yourBoolTag;" Unfortunately, the fastest blink rate is one second as they don't have a GetMilisec() function.
If it is flashing acceptably close to a .5Hz 50% duty cycle using the low bit of that second-of-minute integer, then is Red Lion running this code at a dozen Hz or more?
In which case it might be possible to calibrate the mean cycle time and use a counter to get it to flash at 1Hz or better; it won't be millisecond accuracy, but it might be good enough.
I was not able to see the above images as I was not logged in when I first found this page. It looks like OkiePC has the best solution with Flash(), so "return Flash(1)&&yourBoolTag;" will do the same thing as "return GetSec(GetNow())%2&&yourBoolTag;". The difference is Flash() requires an int, so it cant go slower than once/second while the GetSec() method can only go slower than once/second.