Red Lion Trigers and actions based off of tag data

Brian@HCI

Member
Join Date
Nov 2016
Location
Kansas City
Posts
19
Red Lion guru's,

I am back with an interesting problem==>

I am controlling 2 separate actuators (CAN actuators) in parallel as a SINGLE axis. Since these two actuators are tied together on the same structure I have a need to control them as one "axis" so they don't fight each other naturally.

My problem is I have written some basic code regarding a "differential" routine that makes sure these two actuators do no get out of synchronization by more than a tolerance amount.

I am calculating this "difference" as an internal tag variable (this tag is equal to the absolute value of the difference of the two actuator's positions). So I try setting up triggers that watch this tag - and if the tag gets large enough I want it to run code to correct the actuators by speeding one up that is lagging. I am not sure if this is actually working since I am not seeing the differential close.

Should this be working correctly if I am using a trigger to cause the corrective action to happen?

Brian
 
Events are edge triggered. So your action is probably happening only once if you have "absolute high" and/or "absolute low" as the trigger conditions.

A workaround might be to put your code in a program that gets called "On Tick" which is once per second. At the beginning of the code, bail out if your calculated position error is less than the tolerance.
 
Okie,

Currently the triggers are based on a "Data match" for the tag. If it matches the greater than condition - it executes the code (in theory) but then after the correction it should NOT match the condition at all and should return to the previous state.

How do you set the code to "On Tick"?? I thought OnTick was associated with just the pages for the HMI?? Where do I find the capability of setting it to OnTick??

Brian
 
Okie,

Currently the triggers are based on a "Data match" for the tag. If it matches the greater than condition - it executes the code (in theory) but then after the correction it should NOT match the condition at all and should return to the previous state.

WHile the syntax you are using might be valid, it might not be doing anything. I am picturing you having an expression in the Data Match field? If so, then the data for the tag would have to match the logical solution of the expression (1 or 0).

How do you set the code to "On Tick"?? I thought OnTick was associated with just the pages for the HMI?? Where do I find the capability of setting it to OnTick??

Brian

Click on Display Pages, then click on the word "Pages" at the top of the navigation pane. On the Global tab, there are fields for actions that you want to run for different conditions and "On Tick" is one of them.

If you can zip and post your cd3 file, it would help get this fingered out.
 
Okie,

You are correct! The expression I have for the tag is the following==> "if(difference_Top >= DIFF_TOL_TOP);" So I think if this evaluates TRUE it should carry out my code or am I doing this wrong and thinking about it wrong?

Brian
 
Okie,

My file is attached... pretty small so I did NOT zip it..... but go ahead and take a look. Anything that can show me how to get this thing working is alright with me!

I added a ".doc" and removed the "cd3" extension so that I could attach it.... but you just have to remove the ".doc" from the filename and then it is a regular database file when you add the "cd3" on the end of it again. Sound good? Let me know if you have problems with this and I can then zip it instead.

Brian
 
Yes, the way you have it written, the result of the complex code (which will always be "1" or "0") would have to match the data in difference_Top. And even if it did match, it would perform the trigger action only once each time a match occurs.

I was going to edit this and upload it, but you have two triggers for the tag so I wasn't sure which one (or both?) need to be evaluated in an OnTick program.
 
OK,

So you're saying the complex code is evaluating to a binary value and since the data is not binary it has no effect? How were you going to edit it?

The reason for the two triggers is one says "turn on and fix it" and the other says 'turn off and just set the normal speed.

So what do you suggest to handle this issue?

BTW, thank you for your assistance with this issue!

Brian
 
I would write a program that runs OnTick.

Inside that program:
if(Top_Solar_Panel.difference_Top < Top_Solar_Panel.DIFF_TOL_TOP) return;

//DO THE SPEED CORRECTION LOGIC ...

So if the difference is inside the tolerance, bail out early...

Since this runs once per second, I would ensure that my correction method didn't escalate the problem in the opposite direction too quickly. I'd have to understand more about your application to be more specific...but in general I would expect that you apply a change to some scaling factor or offset or set a flag to denote that the correction has been applied...

It depends on what really will happen with the hardware, how fast it will happen, what are the consequences if it doesn't work...etc.
 
Okie,

Can you run MULTIPLE programs in the "OnTick" option field? I would have to do this for yet another set of panels on my system.

I agree with you about concerns about instability due to the 1 second update frequency - my system is luckily not going all that fast (fastest is .75 in./sec.) so this is a slow responding system.

I am still really concerned why the triggers aren't working though. I would expect an "Absolute Max" or a "change in value" to be able to monitor this well?? I also would think that this would act as the "scaling factor" as you say to regulate how often the correction is applied. I DO use a flag to denote when the change is happening for safety though.

I think your method is good _ I'm just wondering if I have to have a couple of these routines - if they are all permitted to be in the "OnTick" category.

Brian
 

Similar Topics

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
249
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
276
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
Hello All, I need the ability to remotely reboot a Red Lion CR3000 HMI. Due to some graphics issues when the database is updated the HMI must be...
Replies
4
Views
217
I'm trying to use a Red Lion Cub counter (Cub5B00) as a counter and give the cub's counts to a Graphite G12 PLC/HMI to display. After about an...
Replies
1
Views
108
Back
Top Bottom