LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDC001

Solved!
Go to solution

Hello I am attempting to control a ThorLab TDC001 apt servo controller using LabView but without using ActiveX. The ThorLab tech support has sent me the Host-Protocol commands but for some reason I can't communicate with the servo. Can anyone tell me how I go about send the hex commands using MAX or LabView?

 

I have the servo set to act as a COM port and MAX sees that port but it get an error whenever I send commands and MAX says that it can not access the device using VISA

 

Error opening resource:
ASRL3::INSTR

ISA:  (Hex 0xBFFF0072) The resource is valid, but VISA cannot currently access it.

 

Windows 7

LabView 8.5

 

Thanks

0 Kudos
Message 1 of 16
(4,472 Views)
You typically get that error when more than one program is trying to access the port. Windows does not allow that. Make sure you don't have a vendor's program or MAX open.
0 Kudos
Message 2 of 16
(4,464 Views)

I've made sure to only have 1 program open either MAX or LabView or APT. I've been trying to send Hex commands via the Test Panel but the motor won't respond. Is there a way in LabView to send the Hex commands directly to the servo?

0 Kudos
Message 3 of 16
(4,460 Views)
You won't be able to do anything until you get rid of the error. Check for a service that might be running.
0 Kudos
Message 4 of 16
(4,454 Views)

Okay, I quit everything, powercycled, yadayada... now MAX is saying the Device Status is working properly. I've set the port settings (Baud etc) to match what ThorLabs has told me the settings are and validated and it seems OK.

 

So how to I go about sending these HEX commands directly to the servo?

0 Kudos
Message 5 of 16
(4,449 Views)
In LabVIEW, you can simply set the string control for hex display. Or, create a U8 array and use the Byte Array to String. Or, use a U8 numeric and typecast it.
Message 6 of 16
(4,443 Views)

I've attached the VI I'm trying to use just to send the basic commands. Am I making a mistake somewhere?

0 Kudos
Message 7 of 16
(4,435 Views)

So I changed the write buffer to use an U8 array with a string conversion. I'm trying to send a hex code of 23 02 00 00 21 01.  Thus far whenever I run the program nothing happens (or LabView tells me the Visa resources is valid but can not be accessed, but that's unusual).

 

I know this command works because I can send it through using a Python script and have the servo respond.

 

Any ideas?

0 Kudos
Message 8 of 16
(4,397 Views)
I'm on my phone and can't use LabVIEW right now. Can you create a png of the block diagram and attach it? Front panel as well.
0 Kudos
Message 9 of 16
(4,391 Views)

Sorry for the tardy response. Here's the picture you ask for.

0 Kudos
Message 10 of 16
(4,361 Views)