Expression help

davesbs

Member
Join Date
Sep 2005
Location
San Diego
Posts
19
Can anyone fill me in on how to translate the pipe symbol below. I am converting some ladder logic (rslogix5) to structured text(rslogix5000) and this particular expression is used in the CPT(compute) instruction. Since there is no cpt instruction in ST im forced to use this (destination := numeric_expression;). The only problem im having is an error saying:
Error: Line 15, '|': Unexpected.

This is line 15

//SFilterIntCalculated.FilterIntExponent := (-1.0 * 0.0) | SFilter.FilterTimeConstant;

This is the expression directly from the ladder logic.
//(-1.0 * F135:110) | F259:0

What im using in place of CPT instruction.
destination := numeric_expression;

Any help will be greatly appreciated.
 
davesbs said:


This is line 15

//SFilterIntCalculated.FilterIntExponent := (-1.0 * 0.0) | SFilter.FilterTimeConstant;

This is the expression directly from the ladder logic.
//(-1.0 * F135:110) | F259:0

Pardon my ignorance but wont SFilterIntCalculated.FilterIntExponent always be 0 due to (-1.0 * 0.0 )
 
Ken Moore said:
The " pipe" is used for division. So " | " in a PLC-5 = "/" on a keyboard.

the pipe on the keyboard is this

KEYBOARD.jpg
 
Ok had to look at it closely, it appears that AB uses the vertical bar | for division; which is what Mickey highligted.

Expressions - The expression is zero or more lines, with up to 28 characters per line, up to 255 characters. Instructions that can be used in the Expression include: +, -, *, |(DIV), SQR, - (NEG), NOT, XOR, OR, AND, TOD, FRD, LN, TAN, ABS, DEG, RAD, SIN, COS, ATN, ASN, ACS, LOG, and ** (XPY). The execution of a CPT instruction is longer than a single arithmetic operation and uses more instruction words.

I think his expression will use an F type data file where 0.0 is, look at what he states is actual code:
//SFilterIntCalculated.FilterIntExponent := (-1.0 * 0.0) | SFilter.FilterTimeConstant;
 
Since in the SLC500 and PLC5 the '/' character is the bit delineator then for the CPT insturcion it is necessary to use the '|' character to denote division.

Its a matter of N7:0/2 vs N7:0|2 and what each statement means.
 

Similar Topics

Hello Everyone, First time poster here. I have run into a problem with testing my HMI program. (I'm using FactoryTalk View Studio ME Edition...
Replies
2
Views
1,384
I need help understanding what this expression is doing. specifically the (&8192) portion. This is in a visibility animation on a label in RSView...
Replies
3
Views
1,144
I am using multi state color animation. My current expression is this. SEVERITYY is an Analog tag. When i set my tag value to 750 and above i...
Replies
5
Views
5,468
RSL5K, V30, L85 Utilizing an FSC to find a value less than 1116, and greater than 1100. I canT seem to figure out how the expression is supposed...
Replies
19
Views
5,405
I am after some help with animation expressions using the parameter setup in ME. I am using ME 8.0 in conjunction with SLC 5/04 I have made a...
Replies
4
Views
4,336
Back
Top Bottom