SLC 503 floating point to binary conversion

D

Thread Starter

Dane

I have just recently completed a project in which i was controlling an Allen Bradley servo motor with a ultra 3000 drive (with device net) and a slc 503.

With the servo motor in indexing mode I had to write a 32 bit pattern to the drive for the position control. To do this i had to write a rather tricky subroutine/algarithm to convert my 32 bit number ( floating point) into its equivelent binary form.

Does anyone know if there is an easier way to do this.

Thanks in advance

Dane,
 
There might be an easier way, using the 32-bit resultant math Status words (S:13 and S:14) in the SLC. If you're sending an index position as a number of counts, and you can calculate it with a MUL instruction, you can take the 32-bit resultant in S:13 and S:14 (ignore the normal Destination address and reset the overflow bit) and COPy it out of the S:13 and S:14 words and into the 1747-SDN output registers.

This is a whole lot easier with Logix, because of it's 32-bit integer capability, but I've even done it with PLC-5 in an application like yours. And yes, the subroutine was a beast.
 
Y

Yosef Feigenbaum

Hello Dane,
If I understand your problem correctly all you have to do is use a COP instruction from a Float to an int (or binary) data file. The COP instruction will copy the FP image into the integer destination. (MOV instructions convert the data to the destination type)

Good luck
(8{)} ( .)
[email protected]
 
Top