Red Lion trigger action problem

Randy Turner

Member
Join Date
Dec 2009
Location
Montpelier, Ohio
Posts
21
I had an issue this morning with a Red Lion Crimson 3 application. I have four "part selected indicator" flag tags that are mapped to PLC bits. Only one of them can come on at a time, as they are controlled in the PLC based upon which fixtures are installed (plugged in) on the machine. In the "triggers" tab of each of those flag tags, trigger one is Active On, 0 delay, and in the General Action I set an internal string tag to the correct part number: Production_Data.Part_Number="T360". I do this for each of the four flag tags, with the part number being different for each one. The internal string tag "Part_Number" was set as retentive. This seemed to work well the first couple of times the fixtures were changed, but last night when they changed fixtures, the last part number stayed in the string tag although the PLC bit for the flag tag changed to another part. I tried switching the internal flag tag to non-retentive this morning, then downloaded, but the string tag was not displayed at all then. I changed it back to retentive and downloaded, then the correct part showed up again. Initially, when I got to the machine this morning and the wrong part was displayed in the string tag, I unplugged the fixture, and the correct part number displayed. I plugged it back in, and the correct part number remained. Any suggestions?

Thanks,
Randy
 
I had an issue this morning with a Red Lion Crimson 3 application. I have four "part selected indicator" flag tags that are mapped to PLC bits. Only one of them can come on at a time, as they are controlled in the PLC based upon which fixtures are installed (plugged in) on the machine. In the "triggers" tab of each of those flag tags, trigger one is Active On, 0 delay, and in the General Action I set an internal string tag to the correct part number: Production_Data.Part_Number="T360". I do this for each of the four flag tags, with the part number being different for each one. The internal string tag "Part_Number" was set as retentive. This seemed to work well the first couple of times the fixtures were changed, but last night when they changed fixtures, the last part number stayed in the string tag although the PLC bit for the flag tag changed to another part. I tried switching the internal flag tag to non-retentive this morning, then downloaded, but the string tag was not displayed at all then. I changed it back to retentive and downloaded, then the correct part showed up again. Initially, when I got to the machine this morning and the wrong part was displayed in the string tag, I unplugged the fixture, and the correct part number displayed. I plugged it back in, and the correct part number remained. Any suggestions?

Thanks,
Randy

The retentive nature of the string tag will hold the value over reboots of the display so as long as the flag tag remains set, retentive or non-retentive shouldn't matter.

I would put a short delay on your trigger, maybe even 5000 ms or more in case there is a bounce in the flag tag or if somehow the PLC has both on at the same time.
 
Here's another way you could approach it instead of using tag triggers. Create a program that continually checks the state of each flag tag and sets the string accordingly. You can execute the program with the "On Tick" action (in the header of the Display Pages area) and it will run once per second. The program would look something like this:

Code:
if (FlagTag1) Production_Data.Part_Number := "T360";
if (FlagTag2) Production_Data.Part_Number := "T361";
if (FlagTag3) Production_Data.Part_Number := "T362";
if (FlagTag4) Production_Data.Part_Number := "T363";
 
A slightly cleaner variation of my previous suggestion would be to set the Source of your string tag to Complex, and use the following code:
Code:
if(FlagTag1) return "T360";
if(FlagTag2) return "T361";
if(FlagTag3) return "T362";
if(FlagTag4) return "T363";
This wouldn't require a separate program or the use of the On Tick action.
 
A slightly cleaner variation of my previous suggestion would be to set the Source of your string tag to Complex, and use the following code:
Code:
if(FlagTag1) return "T360";
if(FlagTag2) return "T361";
if(FlagTag3) return "T362";
if(FlagTag4) return "T363";
This wouldn't require a separate program or the use of the On Tick action.


Both of your suggestions are good ones.

My preference would be to change the PLC program so that it set an integer value based on the fixture rather than using 4 flag tags. Then he could Format the Integer Tag as a Multi-State and then display the Tag.AsText value.

That means that he would only have to use ONE tag rather than 5. But that's just how I would do it.
 
A slightly cleaner variation of my previous suggestion would be to set the Source of your string tag to Complex, and use the following code:
Code:
if(FlagTag1) return "T360";
if(FlagTag2) return "T361";
if(FlagTag3) return "T362";
if(FlagTag4) return "T363";
This wouldn't require a separate program or the use of the On Tick action.

Thank you both for the input. John, I am going to try what you suggested and see how that works. Unfortunately, I will be out of the building the rest of the day and might not see the results for a couple of days. If there are any new developments, I will post again.

Thanks,
Randy
 

Similar Topics

Has anyone ran into the issue with the SendMail() function not working on an Edge Triggered Event on a flag tag? I'm using a Red Lion Data...
Replies
2
Views
2,254
Hello guys, Red Lion - DSPGT000 using RS232 raw driver for port 1 and 2. I am trying to send a serial trigger to 2 microscan barcode (1 on port...
Replies
6
Views
4,729
While they came up quickly with a fix for the alarm date issue quickly I will have to drive around for a week or so, burning up a lot of fuel...
Replies
4
Views
245
From the Red Lion website, after some customer enquiries in the last week or so... Rev. March 25, 2024 [18:30] Just thought it might help a...
Replies
9
Views
275
How do you install update on Red Lion Crimson ver 3.1. Do I just need to run the exe file on the host server?
Replies
1
Views
105
Back
Top Bottom