Crimson 3.0 Program Execution on Timer

RedLionNewbie

Member
Join Date
Jun 2016
Location
Tennessee
Posts
3
I am new to Red Lion HMI's and their Crimson 3.0 Software. I have a program that I know will run properly but I am unable to figure out how to get it to run every five minutes automatically. If someone has as example of some program coding that I can run to accomplish this or a previous thread for reference that I missed in my previous searches, please let me know.

Thanks,
RedLionNewbie
 
There is a way to run a program "on tick", which means every second. Create a small program that increments an integer every time it is run. When the integer is >= 300 (5 minutes), call your other program and reset the integer to 0.
 
There are many ways to skin a cat... here's one more:
Create a new Flag tag, set the source to General and put "(GetNow() % 300) == 0" (minus the quotes) into the source field. In the Triggers tab for this tag, create a new Active On trigger and put your program name in the Action field.

The GetNow function returns seconds and is the base for all the real time clock functions. The percent sign is the modulo/remainder operator, so using this with 300 (number of seconds in 5 minutes) will produce a zero value once every 300 seconds. Your program will be triggered each time this happens.
 
John,

How much load do you think the Flag tag with the expression puts on the CPU ? Do you know how often the expressions for Flag tags are evaluated ?

Since this isn't a time-critical function even though it's time-related, I'm curious about what method places the least burden on the device.
 
I have created a lot of crazy programs for Crimson but I have not had much success bogging it down. The only thing I have done (repeatedly, because I am a little but stubborn and forgetful) that kills it is when I use an expression containing a dynamic tag based expression or user adjustable value as a data entry limit. Crimson will accept it and run it and then go into a reboot cycle that is hard to escape. For all the wide open power they give you, there is enough rope left to hang yourself.

I wrote that Truck Shooter video game in Crimson to explore the animation capability and finally got to see it on real hardware a few months ago. I admit there was alcohol involved during the creation and it still runs like a striped ape on a G12. I have a great deal of confidence in the Crimson engine to do what the emulator will do and have many applications in the field with complex (scripts) data sources and expressions.

I don't have any definitive numbers, but I would not hesitate to run a program "On tick" to handle things like the OP needs.

With all that said, I still might lean toward doing this in the PLC for the simple reason that all the documentation I have read seems to shy away from stating that "On Tick" equals exactly one second intervals. Experience tells me that it is exactly one second. Experience also tells me that it is not guaranteed to stay that way.
 
Last edited:
For all the wide open power they give you, there is enough rope left to hang yourself.
Hehe well put Paul. Although I have to say that Crimson 3 is not as bad as 2, at least it sometimes gives you indications of where the errors lie. With version 2 you could totally lock up the unit with some errant code and you better hope you can remember everything you changed since the last download.

How much load do you think the Flag tag with the expression puts on the CPU ? Do you know how often the expressions for Flag tags are evaluated ?
That's an interesting question and I don't have the answer but I've never noticed a slowdown on my projects due to tag expressions or triggers (which I use quite frequently). In my experience with these units, you'll bog down the comm rate long before you'll overload the processor.
 

Similar Topics

Looking for information regarding what data types are supported in Crimson 3.1 programs. Cstring is self explanatory. Professor Google hasn't been...
Replies
1
Views
1,155
I can't find any information in the Red Lion Crimson documentation about how to use Sub-Programs. I have a number of ladder logic main programs...
Replies
2
Views
1,520
Hi We have a new Red Lion HMI Touchscreen using Crimson 3 program as a replacement for our existing unit. The machine supplier failed(forgot)...
Replies
4
Views
2,004
Hello everyone! I am trying to write a program in Crimson 3.0 that will turn on an output if a number of tags are not equal to zero. When I hit...
Replies
6
Views
2,427
Hi I have a small script I wrote in "Programs" that I want to call when a buttom is pressed on the HMI. How do I call this program from a button...
Replies
6
Views
2,077
Back
Top Bottom