I need help converting from a floating register to two integer words. I'm using a SLC 5/05 and need to be able to write 32 bit data to a servo drive from a floating point register. Thanks for any sugestions.
If your 32 bit data conforms to IEEE 754 floating point standards then a simple COP instruction will do the trick. COP copies bit for bit preserving the original data while MOV performs a data type conversion.
Do a search on this forum for threads dealing with floating point numbers. Also check the knowledgebase at www.ab.com for articles and sample programs on how to work with floating point numbers.
Thanks...I found some other threads on the topic. It turns out that it requires a bit of math to split the floating point register into two integers. Here is a link to another thread that has some sample code... http://www.plctalk.net/qanda/showthread.php?t=19833 ...fun stuff.