Red Lion Crimson 3 Programming Assistance

hernando

Member
Join Date
Oct 2011
Location
Mexico
Posts
2
Hello, Im using Red Lion Data Station and I want to create a program to track a machine availability.

I have in Crimson 3.0 a (Discrete Input) flag tag to keep track of a bit(Machine on/ Machine off) status.

I want to have a timer to start when the tag (bit) is on and to stop when its off.

Then I will just have

Availability = (timer of flag tag on) / overall time
 
Hello, Im using Red Lion Data Station and I want to create a program to track a machine availability.

I have in Crimson 3.0 a (Discrete Input) flag tag to keep track of a bit(Machine on/ Machine off) status.

I want to have a timer to start when the tag (bit) is on and to stop when its off.

Then I will just have

Availability = (timer of flag tag on) / overall time

Since there is not a specific timer function available in Crimson 3.0 your best option is to increment an internal variable OnTick. You can create a complex code in the OnTick field which would look like the code below.

if(inputtag)
MachineTimer++;
 
Since there is not a specific timer function available in Crimson 3.0 your best option is to increment an internal variable OnTick. You can create a complex code in the OnTick field which would look like the code below.

if(inputtag)
MachineTimer++;

Hi Jeremy,
Is this on the wish list?

"Since there is not a specific timer function available in Crimson 3.0"
 
Little OT

Since there is not a specific timer function available in Crimson 3.0 your best option is to increment an internal variable OnTick. You can create a complex code in the OnTick field which would look like the code below.

if(inputtag)
MachineTimer++;

Quick question Jermey will "If (inputag)" work as is or do you need If (inputtag= true)?

Just wondering if this is another shortcut in coding.
 
Quick question Jermey will "If (inputag)" work as is or do you need If (inputtag= true)?

Just wondering if this is another shortcut in coding.

There are many options you can do any of the following

if(inputtag)

if(inputtag == true)

if(inputtag == 1)
 
Quick question Jermey will "If (inputag)" work as is or do you need If (inputtag= true)?

Just wondering if this is another shortcut in coding.


I'll jump in - it will work as shown.

My question is why not do this in the PLC or controller? It will be much more accurate and should be more retentive.
 
Wait a minute. You are logging up/down time from a boolean mapped from a PLC already.

Simply add an event to that tag (in Crimson) and an event log.

You can use the timestamps from the event log to determine totals, calculate projections etc. You could even trigger custom code to update some of those values on each change of state.

I would avoid using on-tick to perform some sort of home-made clock ... use the one built in (after setting/syncing it, of course).

The error in the above method is limited to comms update repeat-ability. If it needs to be more accurate than that, you need time stamps in the PLC.
 
new: portinput

aya
a new question for t RL crowd.
im using t portinput() instruction, it had worked fine for some applications in t past where i knew what the end character was. but now i have an application where i dont know that.

how can i do it?

in t help archive says that t third parameter of this function is
"The end character to match, if any."
i assumed that setting that value to zero, it would accept strings ending w/ any character but it wasnt like that, only accepts string ending with 0x00 ascii character.
is there any other value i could use as default?

anyone can help?
 
If you enter a numeric 0 it will not look for any stop character. You will need to then give the command a valid way to stop such as a character limit or timeout
 
mmm.. im pretty sure i tried that already and it didnt get t string, then i added t 0x00 ascii to t end and worked.

can anyone else try it, please?
 
it worked!

my mistake was that i defined t lenght considering the start character, once i discarded it in t sum, it worked as it's suposed to.

the string in hex
7E 01 01 02 03 08 06

t instruction:
portinput(2,126,0,50,7).... wrong
portinput(2,126,0,50,6).... right
 

Similar Topics

Hi, I am trying to increase the size of the user login pop up using a Red Lion CR1000 7” HMI with Crimson 3.1 software. The login pop up is very...
Replies
2
Views
655
Hello, We are currently running a bunch of g310's connected to their SLC5 PLCs through ethernet. I've attempted to upgrade the program from 2.0...
Replies
1
Views
1,069
Hi I have been using Red Lion products for some time, I had a thought over the bank holiday weekend, As you do. It would be nice if whenever a...
Replies
4
Views
976
Well, I have yet another question for the great minds on this forum! We have a red lion HMI for one of our machines and every time I hook my...
Replies
11
Views
1,608
Yes it's very legacy.. but sometimes it's necessary to use old stuff for fun.. and because it's so much cheaper. Crimson 3.0 had the ability to...
Replies
4
Views
1,577
Back
Top Bottom