LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read Motor position using Galil and Newmark NSC G5

I am currently using a Newmark NSC G5 and I don't have any issue controlling it. I just want it to tell me what it thinks its position is. I am having an issue where it is just giving me 0's when I use the "TP" command. Even when moving the motor I still get a return of just 0's. 

I can get around this issue by just defining the bounds and position every time I run the code but this is a little annoying and I am pretty sure this device should be able to tell me its absolute position 

I have attached a pared down version of my code

I have already tried querying the device and I usually get a time out error when I query the device using VISA 
through the test panel or using this code https://forums.ni.com/t5/LabVIEW/Motion-Controller-Through-Serial/td-p/3795738?lightbox-message-imag...

Download All
0 Kudos
Message 1 of 4
(109 Views)

I don't use Galil myself but a co-worker made a driver for it that I peeked at.  (Can't share it, it's company confidential).  

 

It looks like just sending "TP" returns values for all axes.  Perhaps you need to send "TP x" where "x" is a single axis?  If it's getting all axes at once it may be outputting zero because one axis is there or because it can't convert the list of all values to a single number so it returns zero instead.

 

Galil makes many models though, and it could be my co-worker used a different one.  I believe it was one of the "DMC" models, but I assume the commands are somewhat universal.

 

Also, if you're using the linked code from that 2018 thread using VISA, note that the initial post has many things wrong with it, including the use of "Bytes at port" which you shouldn't use, among other things.

0 Kudos
Message 2 of 4
(102 Views)

I tried every combination of TPX and it still just gives back a 0. 

And yeah for the linked post, I used the solution at the end. 

0 Kudos
Message 3 of 4
(52 Views)

Maybe you need to send the PF "position format" command first?  If it's getting the position in an unexpected format, it could be that the node you're using to convert to a numeric has a problem parsing it.

 

If you can get it to work with VISA nodes instead, I would recommend that.  When you use those binary drivers, it might be easier when it does work but when it doesn't work you have nothing to go on.  You also run the risk that those binary drivers will stop working one day due to an OS update or similar.

0 Kudos
Message 4 of 4
(39 Views)