Metric conversion, With Standard feed through

zavia

Member
Join Date
Jul 2013
Location
usa
Posts
4
This site has helped me many a time so I wanted to give back with something I worked on recently.

I needed to set up a PV HMI in FTME that was more universal, and we didn't want to have to change the plc code that we had standardized any more than necessary. This is the way I came up with to allow a digital tag to switch between Metric and Standard units, both displaying and entering in the relevant units whilst still giving the plc Standard units

1) create a digital tag for your unit toggle button (We linked it to plc tag as well for some other options in the plc we added later) (you could use the CurrentLanguage() = "en-US" but I wanted more flexibility) MACHINE_TYPE\METRIC
2) create your conversion tags (just makes it cleaner and easier if you want to adjust the scales later) ie. MATH_BARS_PSI where PSI = BARS * 14.503778 (we set a scale of 0.1 for a degree of accuracy, of course, you could go further)
3) Using a Numeric input cursor point object set desired tags and calculations
(the key here is that FTME uses the ? to identify whatever value was just entered into the keypad popup, and optional expression will apply its statement before parsing the value to the value tag)
a) Value: desired tag to hold value, INJECT_PRESSURE

b) Optional expression:
If MACHINE_TYPE\METRIC ==0
then ?
ELSE (?)*MATH_BARS_PSI

c) Indicator: is the numeric display for the Standard or metric data (remember the math needs to be reversed for displaying vs inputting)
If MACHINE_TYPE\METRIC ==0
then INJECT_PRESSURE
else INJECT_PRESSURE / MATH_BARS_PSI
(this is also what I put into any non-entry numeric displays)

Now when we enter a number through the keypad it will always send it down to plc in Standard and then convert it to whichever state is required for displaying.

The last thing is temperatures, which we all know is goofy from Fahrenheit to Celsius but here is that statement as well, in case you need it. (F to C = F -32 *0.555)
Value: MOTOR_TEMP
Optional expression:
If MACHINE_TYPE\METRIC ==0
then ?
else (?/CEL_TO_FAR)+32
Indicator:
If MACHINE_TYPE\METRIC ==0
then MOTOR_TEMP
else (MOTOR_TEMP -32)*CEL_TO_FAR

Hope this comes in useful for some other unsuspecting PLC guy who gets a metric job dumped on their lap.
 

Similar Topics

We have several Siemens basic panels in use on a production line. The line was bought from over seas and so all the display screens are using...
Replies
5
Views
3,897
Hi everyone. Here is the question! How a PID works on a Loss in Weight feeder? Gravimetric feed and Volumetric feed as well. What calculations...
Replies
3
Views
2,278
Hello everyone, I am working on a new PLC project wherein the customer wants us to implement a face recognition biometric system that will...
Replies
7
Views
2,660
Hi all, Does anyone have any suitable links to products which can be used with a Siemens 1200 PLC. I am struggling to find any suitable, in an...
Replies
5
Views
2,852
I am using a GE quickpanel+ and connecting it to an Allen Bradley PLC. I have a lot of tags that I am reading from the PLC and displaying on the...
Replies
3
Views
1,994
Back
Top Bottom