Facing an error in RS View32 works

AB2005

Member
Join Date
Nov 2006
Location
Lahore
Posts
318
Dear Friends;
I have been working with RS View32 for designing an HMI. When I write the expressions mentioned bellow, system doesn’t accept and ask expression missing or incomplete which I coloured. Please check and find out the mistake as I am new with this software.

If Shift_2ndstarted = 1 Then Prod_2ndshift Else 0 + Prod_1stshift + If Shift_3rdstarted = 1 Then Prod_3rdshift Else 0

Tags are
1) Shift_2ndstarted
2) Prod_2ndshift
3) Prod_1stshift
4) Shift_3rdstarted
5) Prod_3rdshift
 
This is just my feeling it is,
That you can only have one IF statement at the start, and one ELSE statement at the end, in an expression, all the other IF or ELSE statements probably need to be ELSEIF.
 
Dear Sinc green;

1) Shift_2ndstarted (this tag is 1 after 14:30)
2) Prod_2ndshift (2nd shift production)
3) Prod_1stshift (1st shift production)
4) Shift_3rdstarted (this tag is 1 after 22:30)
5) Prod_3rdshift (3rd shift production)

I want to create a numeric display for total production of the day start from 1st shift (from 06:30). During 1st shift when both tags “Shift_2ndstarted” and “Shift_3rdstarted” would be Zero, total production counter would only display the value in “Prod_1stshift”. When “Shift_2ndstarted” would be 1, then value in “Prod_2ndshift” would add in “Prod_1stshift” and display in total production counter and the same when Shift_3rdstarted would be 1.
 
Last edited:
You could try isolating the If statements with parenthesis.

(If Shift_2ndstarted = 1 Then Prod_2ndshift Else 0) + Prod_1stshift + (If Shift_3rdstarted = 1 Then Prod_3rdshift Else 0)

Or, do away with the If statements, and let math do the work.

Prod_1stshift + Shift_2ndstarted * Prod_2ndshift + Shift_3rdstarted * Prod_3rdshift
 

Similar Topics

Hi Friends, I am facing a problem with encoder adjustment in Sew Electric Cylinder CMS71L. encoder using is Sick Hiperface Drive is MOVIDRIVE...
Replies
17
Views
784
I have a Cognex Insight 2000-130 camera that I'm trying to get talking to my PLC. Both are connected to the same router via Ethernet. Thus far...
Replies
12
Views
1,228
Hi, I am picking up a project started by a predecessor who is now out of contact. It is a Siemens S7-1515F PLC system - but the query is how you...
Replies
2
Views
731
Hi everyone, I've got to interface 4 x Mitsubishi Q series PLC's with an Allen Bradley Compact Logix PLC using a Red Lion Data Station DSPLE000...
Replies
1
Views
505
hello i want to read temperature data from Masibus UT94 temperature transmitter which is giving data on RS485 port. i have assigned ID:-30 and...
Replies
1
Views
1,057
Back
Top Bottom