Micro830 Structured Text

Christoph

Member
Join Date
Sep 2003
Location
Indiana
Posts
345
Trying to put these equations in structured text program in a Micro 830.
when I run the verify I get this error.

;:expected before this new statement Line 2

F_1[2]:=(F_1[1]/1000.0)*60.0
F_1[3]:=(F_1[2]/GEARIN)*0.262


Please advise, Thanks!
 
F_1[2]:=(F_1[1]/1000.0)*60.0
F_1[3]:=(F_1[2]/GEARIN)*0.262

I'm assuming that everything involved is a REAL. GEARIN is a REAL, not an integer, and guaranteed to not be zero.

If integers are mixed in there you usually want to do the multiplies before the divides.

A PLC with good FBD and strong data typing would let you program this stuff so that you can see the intermediate results. You could see F_1[1]/1000.0 before it hits the *60.0 part. In this case you do not have that luxury. Just because you cannot see the intermediates does not mean that you do not have to think about them.

The old Symax Model 300 used 16-bit math. An analog input ranged from 0 to 9999. Lets say you wanted to scale it to 0-1320 for a 132 foot water tank in tenths of a foot. The rung looked like this:

Let Scaled = Raw * 1320 / 10000

The problem was the intermediate result blew up over +32767. It became a real headache to do scaling - probably why it was sometimes done in the HMIs back then.

They fixed the problem in the Symax 400 which allowed 32-bit intermediate results.

The tendency today is to just push anything into a 32-bit REAL and don't sweat the details. Many times that works. Sometimes it doesn't. Check out the thing where the Patriot missed the SCUD and 28 people were killed. That Raytheon programmer loved REALS a little too much.

The moral of the story is to keep data types in mind. We're not JavaScript programmers who don't even know what data type is.
 

Similar Topics

I am having issues getting a Red Lion HMI and Micro830 controller to communicate. I am using the cable here to connect the controller to the RS232...
Replies
0
Views
119
Having to add some programming to a Micro830. I want to add a free running TON, reset with a done bit. in the drop downs or the instruction...
Replies
4
Views
287
Hello, We have a project on our shop floor that for some reason project management decided to not talk to controls about and pick some...
Replies
2
Views
1,325
I have an application using an A-B Micro830 controller. Does anyone have a PDF tutoring how to program one of these. Not very intuitive especially...
Replies
23
Views
6,554
I was trying to upgrade a micro830 to firmware 12.013 and was unable to connect. I searched online several times with most results sending me here...
Replies
2
Views
3,561
Back
Top Bottom