1st post...here we go... CJ1Mcpu22 ETN

trubleshtr

Member
Join Date
Oct 2008
Location
GTA
Posts
25
Hello,
First time poster here so go easy..
I need some Omron advice on using the Hex value in the D area of PLC. I am trying to view it on an HMI in Decimal. I will give you a little background,
I have been handed the task of re-programming a machine, which has not been completed by a contractor. I am more familiar with A/B so I am struggling with the half done program in Omron that has been left for me. This machine set-up is using excel for info,a VBA script to transfer data to PLC and then The HMI is looking at a D area (D112) to get it's value to display, I see that Omron D is in hex, (this hex value is being displayed on HMI) how can I get the value into a decimal form? Can I simply put the D112 value somewhere else in the PLC (via MOV)and save it as a INT or BCD and then re-program the HMI to look at that location? Can I be that lucky hehehe..
I could spend time with trial and error, but seeming as We are already in trouble with an incomplete machine (which of course is needed) I am looking for a "get out of jail free" card here.

Cheers
I suffer from I.D. 10T error's
 
Hi
Welcome

You have 2 options.
1.On your HMI make sure the representation is BCD Not DEC.
If you don't want to play around just convert this value to real and show it as a real on your HMI.(it will take 2 words).
Omron can be very confusing with representation value unlike AB.
I dont know how you got this numbers but.
If to write constants with# you have BCD/HEX (like mov #100 Dxx)
if you put With & You have decimal.(like mov &100 Dxx)
Make sure your view is on decimal.
View -> Monitoring Data Type ->Decimal.

Good Luck
 
The HMI is looking at a D area (D112) to get it's value to display, I see that Omron D is in hex

This is not true. The data memory (or register) area is purely and simply a memory area. The number type representation dpends entirely on what is being placed there. It can be HEX, BCD, decimal, floating point or ASCII dependant upon the function used to place data there.

For example, if a calculation is performing decimal maths, the value will be decimal. If you are using an area to formulate a text message or message to be sent via SMS, the value is usually ASCII but can include numbers.

I assume you are using CX-Programmer. You can select which data type to display in the DM area.

Further, the HMI should be able to be programmed to display the word type.. For example, if the HMI is an Omron NS8 series, the allowable word types for display are INT, UINT, DINT, UDINT, REAL, and various types of BCD values. The word types will probably increase in the future to include LINT (4 words unsigned decimal), ULINT (4 words signed decimal) and LREAL (64 bit REAL value).

The word types confirm with the IEC standard and there are a few more to boot to give backward compatability.

The easiest way is certainly to change the word type for display on the HMI.
 
Thanks for the response guys..


BobB said:
This is not true. The data memory (or register) area is purely and simply a memory area. The number type representation dpends entirely on what is being placed there. It can be HEX, BCD, decimal, floating point or ASCII dependant upon the function used to place data there.

So is it fair to say that the last instruction that writes to D112 will be the "format" in D112?

he has accessed it several times in his program with diff. instructions everytime, some are stored as &D112 some as #D112
and one is showing the word 'hex' after the value in the instruction.

Also is there a refference somewhere as to what all the different prefixes mean? the cx programmer help file aint much help in that department.

Prefixes like
@,#,<,^,<,&,<,*,W

I assume then that # is for a constant fixed value
and & is for a decimal value?

Can I view the data in the registers somewhere? other than the instruction on the rung? I opened the "memory" icon on left panel and went to "D" values but I see nothing in the registers? is this the right place to look?

Thanks again for all your help guys
 
Here are some pointers.
BobB is correct. The memory areas are storage registers. Lets say the data stored in D112 is 1234. You don't really know if that is 1234 HEX, or 1234 DEC. It depends on how you use it in the program. Some instruction use HEX data (*L is a long Binary multiply). That would treat the 1234 as 1234 hex (4660 dec). Other instructions expect the data to be BCD (*B is a BCD multiply). That would treat the data as 1234 decimal.

Bottom line on data types is to look at what data type the instructions you are using need.

You went into the correct area to monitor the data, but you did not click the yellow triangle icon to Monitor the data.

* and @ are forms of indirect addressing.
# is a hex constant, & is a BCD to hex conversion constant.
If you want the HEX equivalent of 1234 BCD stored in DM75, you would do a MOV &1234 D75. If you viewed the data in the HEX view in CX Programmer, you would see 4D2, the HEX equivalent of 1234 dec that you entered.

W is a different memory area (the Work area).
 
Thankyou guys...this is making alot more sense to me now.It's always fun to learn new things.
Once the HMI display is working correctly, my next step will be to figure out how to put live data back into the Excel file via ethernet and save it. Wish me luck,They are using a VBA script, another language for me to learn. ;)
 
@ is a one shot (diff up or rising edge trigger) for a function - & is a for a binary value - # is for a BCD or HEX value.
 
Thanks, I have the machine cycling now, I re-wrote the ladder my way and learned the instructions as I went, I was able to quickly apply the correct pre-fixes to the values thanks to you guys...

My next step is to scale the live analogue readings into the HMI to be viewed live, and record them back into an Excel sheet aswell.

Eventually.. I need to figure out how to network all this. So they can do the set-up from one location and send it to the machine. Operator then does physicall set-up, machine runs, then all the processed data from the test needs to be put back into an excel sheet and accessed again from a distant location for review. So I guess I will need to learn more about VBA scripting in Excel and Ethernet set-up in Omron.....Steep learning curve ahead!
Thanks again for your help guys.
 
Here is a link to a 'scale with parameters' FB

http://forums.mrplc.com/index.php?download=523

If you can handle floating point it is a good way to go. I normaly use Omron NS screens and thay can handle floating point. Just be careful if you have to 'FIX' back to decimal, you will lose the decimal places.
 
Thanks I will give it a try, I am fortunate in that the previous contractor did all the hard wiring, I just have to see whats connected to what input/output and program. I'll let you know how it turns out
 
I was able to take the live pressure readings from the AD card and move them to Dm without any need for scaling, the values are not floating point, so it seems to work ok. One more hurdle overcome.
 

Similar Topics

As far as I know the UKCA mark is mandatory from 2023, and that is 9 months from now. That is not a lot of time to investigate, design, validate...
Replies
22
Views
4,693
Hi All, I cannot seem to find a way to move a Boolean from an Arrays UDT into a DINT. I have an Array of 32 elements with a UDT data type of 4...
Replies
3
Views
1,720
Stupid question i know but i know i have seen this done before and yet i cant get it to work For the preset value of a TON I want to use a tag...
Replies
3
Views
1,794
Hey guys, I need help calculating first Monday of the month. Has anyone ever had to perform such calculation? Rockwell has UFDB that calculates...
Replies
10
Views
2,637
Hi, I have received a copy of a PLC program for a customers Carton erector that uses a beckhoff PLC and HMI. I just downloaded the trial version...
Replies
8
Views
2,202
Back
Top Bottom