GE Fanuc INT to REAL

cai1

Member
Join Date
Apr 2011
Location
Alberta
Posts
5
How do i convert two 16 bit INT words to one 32 bit REAL word?
In AB a simple COP instruction will do this but I am new to Fanuc (Proficy ME) instruction sets. Tried INT TO REAL but looks like it is just a value to value conversion.
 
Figured it out, first had to swap word order using MOVE INT high word to low word, MOVE INT low word to high word. Then create new TAG with data type REAL and reference the first word of data.
Still, is there not an instruction that can have an IN as INT for length of 2 and Q as a REAL data type?? Seems I have taken AB friendliness for granted!
 
I'm not sure what you mean by "convert two 16 bit INT words to one 32 bit REAL word".

If the two 16-bit registers contain the bit pattern for the 32-bit floating point value, then you don't need to do any conversion. Simply define a REAL variable with the starting address of the lower of the two 16-bit registers and you'll have it. How did the PLC get the word order reversed in the first place?
 
Polling floating point values from a modbus RTU device (scadapack) via CPU363 serial port configured modbus master. Data is transferred as two 16-bit words into %R registers and then needs to be converted back into a 32-bit real. Other modbus master devices (prosoft, modicon, etc) do not require the word order to be swapped when converting back to floating point but it seems the 90-30 does. After some experimenting I found that the MOVE_REAL instruction does take two INT registers and outputs Q as a real. Similar to the AB COP or CPS instruction.
 

Similar Topics

I am working on a project Retrieving data from incoming power and such. Here is the questions 1046 R is a DINT it has a value of whatever. When I...
Replies
3
Views
1,776
Hi Guys, I was given a task to configure using level setpoint to have an output of 4-20ma equivalent using GE Fanuc 9070. Is this possible? If...
Replies
1
Views
2,050
What is the benefit of the 6 point toolframe setting method as opposed to the 3 point method. I understand that when I use the 6 point method I...
Replies
5
Views
6,940
HI GUYS,, what is "length", for what is it? can anyone help me with this? the "4" is chosen from range 0-256 (256 is the limit) Thanks
Replies
7
Views
5,389
Let the rumors begin. http://www.gefanuc.com/news-events/detail/2618
Replies
4
Views
3,125
Back
Top Bottom