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!