LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Thorlabs KDC101 Communication

Solved!
Go to solution

Hello,

 

I recently received a Thorlabs KDC101 controller and have been instructed to build a custom GUI for it (not using ActiveX and APT). So my question is, has anyone done this before? There are not any LV drivers for this particular controller that I am aware of. I have been trying to set up initial communication via USB and serial, but have not been successful. I am planning on sending commands to the controller via strings, but I am also not sure on the syntax to send the strings. The attached PDF has me confused, maybe someone could help me with that and/or the communication part?

 

Thanks in advance for any help!

SM

Download All
0 Kudos
Message 1 of 28
(14,269 Views)

Are you also not allowed to use the Kinesis .NET drivers to control it?  It would be much easier than interpreting that manual.

 

Internally, all Thorlabs K-cubes (and probably the rest of their hardware, not sure) use FTDI chips to communicate.  At the very least you'll probably need to use that DLL as an interface.

 

D2XX Direct Drivers

Message 2 of 28
(14,256 Views)

Kyle,

 

Thanks for the reply. Correct, I am also not allowed to use the Kinesis .NET driver to control it. I know it'd be easier, but I'm just following the instructions I have been given...

 

I will take a look at the DLL per your suggestion.


Do you happen to know about how to send the commands to the controller via strings? Or if that is even possible?

 

Thanks for the help,

SM

0 Kudos
Message 3 of 28
(14,253 Views)

I'm pretty sure the only commands the controllers accept are those listed in the manual, which is basically byte packing.  You'll have to set up routines that assemble the header for each message (page 12 of the manual) and then for each message you want to send, assemble its precise syntax (pages 19 to 112!).

 

Is there a particular reason you can't use the drivers? 

Message 4 of 28
(14,248 Views)

Ok, I think understand that, but I'm not really sure how to do the header and the syntax (pages 19-112) are confusing. Like the syntax itself, not sure if it's supposed to have commas, or no commas, etc...

 

The reason why I can't use the drivers is this will be integrated with a large modulated software package that controls a long list of other controllers. They kind of have a template that basically you just choose which controller you are controlling and then send it commands. This K-Cube is one of them. And like I said they want everything to look the same, so my GUI has to look the same as the others. But that will come later, first, I have to get the communication set up correctly..

 

I tried to download and install what you sent me. But once I downloaded the D2XX driver, there was nothing in the zip file that allowed me to install anything?


Thanks,
SM

0 Kudos
Message 5 of 28
(14,244 Views)

I still never figured out how to download DLL driver.

 

I did find this example though that sends data via strings. I did identify my controller (even though I never downloaded any additional drivers). I still cannot figure out the syntax to write data to it, such as get the controller to output a voltage or move a stage or anything. Any examples for that? Attached is the VI I found that sets up communication for writing in string format.

 

Thanks,
SM

0 Kudos
Message 6 of 28
(14,237 Views)

Actually you don't need to have a GUI on your front panel to run the drivers for either the APT or Kinesis code.  Yes, the examples they show you make it look like you do, but there's a way around it.

 

Here's the .NET code that creates the reference with no front panel GUI created at all:

Creade K-cube no GUI.png

Message 7 of 28
(14,231 Views)

Kyle, I failed to mention I am using LV 2013 so I can't use your snippet. Can you post an older version of your snippet please?


Thanks,

SM

0 Kudos
Message 8 of 28
(14,229 Views)
Solution
Accepted by topic author Sman29

I don't have 2013 to make a snippet so I just saved the VI back.

 

 On another note I should mention that I had some problems with the Thorlabs Kinesis DLLs and where to store them.  You may want to look at the previous thread I made regarding them:

 

http://forums.ni.com/t5/LabVIEW/Problems-when-instrument-driver-NET-DLLs-call-other-NET-DLLs/m-p/332...

0 Kudos
Message 9 of 28
(14,215 Views)

Kyle,

 

Your code wouldn't work without 2 DLL's that I don't have... I did find this example of the website you posted earlier (see attached). It appeared to connect and identify my K-cube. However, I still don't know the exact syntax to send the strings as. Can you show me an example of say, send a message to identify (which blinks the LED's on the device)? Or a command to move a stage to a certain location? I attached a document earlier that has the commands and stuff, but I've tried different methods and syntax's for this, and I was never able to read anything back from the controller...


Thanks for the help,

SM

0 Kudos
Message 10 of 28
(14,188 Views)