Macro Tutorial?

CalG

Member
Join Date
Feb 2013
Location
VT
Posts
197
I'm making great progress replacing a panel of buttons with a wiz-bang HMI.

But with so many "features" in the HMI, it is only natural to want more.

At present I am working with Data Display for 12 Analog input channels. 8 ch of 0-10V and 4 ch of 0-20ma. These take care of monitoring the various stand alone devices associated with a vacuum coating tool. (vis. pressure, temperature, amps and volts)

Display pages have been made for trend, both History and Real Time, Data displays, numeric displays and numeric inputs, bar graphs and meters. All well and good,

Except for resolution! and the lousy decimal point.

Presently I am using the math functions within the plc logic, (-32768 to 32767 or 0 to 32767 divide by 33, move to %Rnnnn etc., giving up much desired precision in the division of a non float) and then displaying the data without decimal points. Text object Legends are added to the graphics to cover the deficit. I feel this may become confusing to the uninformed observer. (The Numeric display scaling function goes a long way towards making everything obvious, but the trends and meter displays can be confused.)

What is wanted is to take the 16 bit signed or unsigned data from the plc (GE 90/30 without FP) move it into the HMI and then perform a conversion to FP format. Store this converted data in a HMI internal memory location (LWnnnn) and then use the data value in multiple graphical displays. A typical page would include a trend graph, a meter and a numeric display for any one, or a combination of several analog inputs.

I've been advised that the conversion from 16 bit signed/ unsigned to FP is best done with a macro.

I've looked through the several hundred pages of macro instructions more than once, but don't seem to be able to "translate" the helps and directions. (Painfully aware of my "programmers" ineptitude).

Perhaps it is just the "writing style" of the mfg, macro instructions. Of , just me.

A couple of things stop me before I start.

If I use the "Get Data" instruction, How is this implemented in real time displays? The macro instructions suggest all macros need triggers, with no mention of time base.

If there is not a "canned instruction" to convert a signed integer to FD, what macro instructions do the job ?

Are macro instructions "common"? Or unique to each panel mfg.?

That is, can I learn from "generic" macro tutorials?

Finally, and to my post header. Are there such macro references?
I am capable of learning, but when the definition uses the same term as my question, I fall apart ;-)

note harware:
PLC= GE 90/30 311 with 3 ea. 4 channel Analog cards
HMI Wientek 8070h Connected via Horner HE693SNP900 interface card

EB8000 and LM90 software

If you read this far, Thanks!

Comments appreciated

Cal
 
I don't program those devices.
most HMI's can scale values in the screen itself.
your analogues must give you a digital value (up to 16 bit)
possibly the scaling can be done totally at the HMI when it is displayed.
I hope this helps a bit
 
I'm making great progress replacing a panel of buttons with a wiz-bang HMI.

But with so many "features" in the HMI, it is only natural to want more.

At present I am working with Data Display for 12 Analog input channels. 8 ch of 0-10V and 4 ch of 0-20ma. These take care of monitoring the various stand alone devices associated with a vacuum coating tool. (vis. pressure, temperature, amps and volts)

Display pages have been made for trend, both History and Real Time, Data displays, numeric displays and numeric inputs, bar graphs and meters. All well and good,

Except for resolution! and the lousy decimal point.

Presently I am using the math functions within the plc logic, (-32768 to 32767 or 0 to 32767 divide by 33, move to %Rnnnn etc., giving up much desired precision in the division of a non float) and then displaying the data without decimal points. Text object Legends are added to the graphics to cover the deficit. I feel this may become confusing to the uninformed observer. (The Numeric display scaling function goes a long way towards making everything obvious, but the trends and meter displays can be confused.)

What is wanted is to take the 16 bit signed or unsigned data from the plc (GE 90/30 without FP) move it into the HMI and then perform a conversion to FP format. Store this converted data in a HMI internal memory location (LWnnnn) and then use the data value in multiple graphical displays. A typical page would include a trend graph, a meter and a numeric display for any one, or a combination of several analog inputs.

I've been advised that the conversion from 16 bit signed/ unsigned to FP is best done with a macro.
Cal
Why not do the scaling under "Tag Properties".
Then use the same tag for all displays and such.
Here's a screen shot.

Hope this makes life easier.
I'd stay away from a macro as this can be done a lot easier within the tag properties.

Scale_tag.jpg
 
Here's a quick macro.
Copies the INT from your PLC and Stores it to an internal location/register of the HMI.
Not sure if it helps any but you get the idea.
You have to define "source" and "result" for the macro.
Then do your coding for it.
In this case we are manipulating integers (int).
If you were to do something with REALs you'd use "float"
Have fun.
I insist that manipulating/scaling the actual tag will be a lot easier to follow by someone else a few months/years later.

macro.jpg
 
bkottaras and iant

Thank you for your suggestions.

In fact the scaling through the numeric display object is what I am doing. (mentioned in my too lengthy first post)

However, the scaled result is not made available for any analog display such as a meter or bar graph object. (I'm an analog sort of fellow, I see much more with just a scan.

With that, If a numeric display object is created, and also a meter object using the same reference value, I am left with a mismatch of values by some factor, as the meter display (or a bar graph object) does not offer similar scaling. At least I have not seen so. The work around is to give up all resolution right of any decimal point by using the division function in the plc., or placing text objects manually on the graphic. Somewhat tedious and inflexible with change. Also, the math functions in the HMI "appears" more powerful, and with a single data transfer to the HMI and then doing the math there, data processes should be faster. Perhaps that is not important. I don't know.

In particular, Creating a meter display for the purpose of temperature indication is made almost impossible for the display of values < zero UNLESS the read reference is a designated a 32 bit float. Please note that this plc has no REAL capability! Yes, "just go buy a modern plc".... It would be nice, but is not in the budget.

I am stumped as to how to get a 0-32676 count value into the required configuration and still display values with resolution to 0.1 degree. (I do not need the meter face to show those numerals, but it would be nice if the pointer had an analog "look" rather than jumping from one whole number value to the next.

Thank you for the macro example as well, Your example follows the samples in the help files. Being entirely new to such creations I need examples that flesh out the content. (Yes, crawling from under some rock of time on this front) would a real data transfer macro look like the following.

macro_command main()
int %AI0002
int LW1250
%AI0002=LW1250

end macro_command

Would this macro run constantly in real time?
I have also a question on the EB8000 help file. When a topic is opened, and tabs are selected, there is often a first line on the displayed page that reads

"Click on items in graphic below to call up help for that item"

Clicking on tabs seems to work as described, but clicking anywhere else on the page returns an error. Is there something wrong with the instruction? My installation of the application? Or is the help just not completed?

Your responses are appreciated...I'm work at it ;-)

ps working on the "Tag Properties" angle now!
 
Last edited:
I did not have any time to do the macro, I don't use macros anyways but here's a couple of screnshots.
Based on an inpot 0-32767 and scaled to engineering units -1.5 to 100.
They'll do the x.x resolution trick.
Not sure about the 0.1 though.

NumDisp1.jpg NumDisp2.jpg NumDisp3.jpg NumDisp4.jpg
 
I've had similar results today

Thanks for your time and efforts!

Being the holiday, distractions came along but...

Adding the decimal seems easy if the Tag is used as reference,

The inclusion of negative scale values remains a puzzle/

If counts 0 through 10000 represent temps between -30 and zero,
with counts between 10001 and 32767 the positive scale, How is a meter object formatted?> When I do what you have posted, and add real input, The displayed results are nonsensical.

It is likely staring me right in the face, I often miss the obvious ;-)

Cheers

Cal
 
Last edited:
bkottaras

I noticed in these .jpg screen shots that the METER object did not display the desired information.

Same trouble I have ;-) Any Ideas how to get around that?
 
I haven't had a chance to look into it.
I do not have the software with me either so can't test anything.
If i do get a chance to try it I will post something on here.
The meter in the jpg is just there and I used the scaling function to display the x.x numbers.
 
Don't go to any trouble

I've got it sorted out. Posted my method too ;-) (just trying to help, even if I was talking to myself ;-)

But if there is a simple way, I'm all ears.

I could get the meter object to display OR the scaling to work, but not both at the same time.

Not displaying the meter scale numerals was the only method I could come up with.

Regards

Cal
 

Similar Topics

Hello, I'm new to a program EBpro and I have to find a way to make a numeric object's background change colors depending on read data from plc...
Replies
3
Views
300
Hello everyone, this is my first post. FactoryTalk View SE v.13 I have a macro defined in my project that I would like to call up when someone...
Replies
0
Views
304
Hello Guys, I have been trying to study a Machine that have Omron 3g3mv VFDs that is controlled by CJ1m CPU and SCU41-V1 communication card. The...
Replies
0
Views
475
Hello Guys, I have a packaging machine in the company that I work for that have 8 Omron VFDs (3G3MV ) that are controlled via Modbus with CJ1M...
Replies
1
Views
639
Hello there. How to transfer data from one memory area to another using macro? Data Type - Double Word Length - 4 Format - BIN Integer -...
Replies
0
Views
652
Back
Top Bottom