CIP Generic Message

prerak

Member
Join Date
May 2012
Location
Vadodara
Posts
1
Currently I am working on communication between PLC and java through Ethernet using CIP message instruction.

I have successful done communication by transmitting Integer data. Now i want to transmit float data but the N file for message instruction is of integer type only. so please help me.

Do Send me anything related this..

regards.
joj
 
Welcome to the forum!

I assume that you're using a Micrologix or SLC, based on your mention of an N file, but if you can specify the exact model it will help us be more accurate.

The way floating point data is usually sent with a MSG instruction is by splitting it into two integers. A quick lesson, if you don't already know it:

- The MOV instruction moves a VALUE from the source to the destination. If you have a floating point register with a value of 100, and you MOV it to N7:0, N7:0 will now have a value of 100. If your floating point has a value of 100.9, when you MOV it to N7:0, it will be truncated to 100. Obviously this is not what you want.

- The COP instruction copies a BIT PATTERN from the source to the destination. If you have a floating point value of 100.9 and you COP it into say L9:0 (L=long integer, which is a 32 bit integer), L9:0 will now have a meaningless value in it because an INT value is interpreted differently to a floating point value. But the bit structure is preserved, so now you can send this to your PC and when read as a floating point value it will have the original value.

So what you will need to do is COPy your floating point data into sequential N registers, send it to your PC with the MSG instruction, and then reassemble it at the other end. For example, if you want to send 10 floating point values (F8:0-F8:9) to your PC, first use:

COP F8:0 N7:0 20

Which will copy F8:0 into N7:0 for a length of 20. Then send N7:0 through N7:19 to your PC.

One more quick note - you will see that I set my length to 20, not 10 - because the length is in terms of DESTINATION ELEMENTS. You will copy 10x 32-bit registers into 20x 16-bit registers, so you need to specify 20 for the length.

Hope that makes sense!
 
Joj, you need to provide some more details about the control platform and MSG instruction you are using.

What model of controller ?

What message type ?

In general, you can send REAL data just as easily as you can send INT data, but I am in no mood to guess about which menus and dialogs you are looking at.
 

Similar Topics

Hello, PLCS.net guys. I'm learning about MSG for TCP communication recently. I'm trying to use CIP Generic. And the main flow is like the one...
Replies
6
Views
1,231
I have an upcoming job where I will need to communicate via Ethernet between a PLC5/40E and an ABB AC800. The ABB is equipped with their PE1364C...
Replies
1
Views
5,495
Having an issue with network timing out when trying to use CIP generic on a Micrologix 1100 B. I’m trying to read flow and totalizer information...
Replies
19
Views
5,021
Hello, I am using a 1756-EN2T and tryin to communicate with a device that accepts ASCII string over ehternet usin UDP. Do packets sent using CIP...
Replies
8
Views
1,797
Hi All - I am trying to communicate between a Micrologix 1100 and a Powerflex 525 via CIP MSG. There is a great Knowledgebase and TechNote...
Replies
3
Views
3,994
Back
Top Bottom