Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming an AD9858 in Linux using USB-Parallel adapters

I need to program 8 AD9858's in linux using USB to parallel adapters. 
The goal is to have one piece of code to run all 8 devices and be able to change frequencies on the fly.  I also need to be able to match phases.
I'm starting with labVIEW but its looking more and more like I'm going to have to use a piece of C code.

Any advice would be greatly appreciated.
0 Kudos
Message 1 of 8
(8,508 Views)
Hey Ben!
The first thing I would do is use some kind of a "hyperterminal" program (mini com?) to make sure you can communicate with the device.  Then, I would access measurement and automation explorer to make sure that your parallel port is there.  The last step, once you verified communication with minicom and parallel port access in MAX is to use sample program in LabVIEW to do simple read and writes to each of the ADCs.  Hope this helps!
Best Regards,
Song Mu
National Instruments San Diego
0 Kudos
Message 2 of 8
(8,485 Views)
I need to program the devices in linux, so I don't have MAX.  Since I'm doing it in linux, the parallel port tools provided with linux don't work so I have to use something like a USB to Parallel adapter.  If theres an easier way to do this I'm all ears.

0 Kudos
Message 3 of 8
(8,474 Views)
Hey Ben!
Sorry about that, so let me understand you, you are using your USB port to communicate.  Most likely, you will have to use USB raw; however, is there a way you can verify communication with the device right now?  Do you have any way to monitor the bus?
Best Regards,
Song Mu
National Instruments San Diego
0 Kudos
Message 4 of 8
(8,466 Views)
I can get the device running in every environment but labVIEW.  I've installed the hotplug for write permissions and ran labVIEW as root but it still will not show up with find resource.  Also I know the bus its on and its PID and VID.
0 Kudos
Message 5 of 8
(8,463 Views)
Hey Ben__J!

Here is some info regarding how to use the USB-serial communication in VISA on linux, this should apply to USB-parallel

To use your third-party USB serial interface with NI-VISA in Linux, you will have to add it as a static resource using the NI-VISA configuration utility (visaconf). Visaconf installs with NI-VISA so you need to have NI-VISA installed. See the related link below for the most recent version of VISA for Linux.
Follow the steps below to set up your device:
  • Open a terminal window and type "visaconf" to open the VISA configuration utility window.
  • Click on the "Add Static" button to bring up the "Add new static resource" window, and choose "local serial port" from the Select Interface list.
  • Pick an interface number, and type /dev/ttyUSBx in the "Binding" field, where x stands for the port number on the USB serial interface; so for instance, if you have a 2-port interface, you would type /dev/ttyUSB0 for the first port, and /dev/ttyUSB1 for the second port.


Please note that Linux treats serial ports like files and you must have the appropriate permissions to read/write to the port. See the link below for more information.

Another work around would be to try adding a token to the visaconf file: "WriteTimeoutGranularity = 0" under section "[ASRL-RSRC-ALIAS]".


Best Regards,
Song Mu
National Instruments San Diego
0 Kudos
Message 6 of 8
(8,450 Views)
I've done this and tried the example VI for USB communication but it can't or won't find that resource since it then thinks its a serial port.  Parallel ports don't work in linux-labVIEW so treating it like a parallel port is out of the question.  The method I'm working on right now is to try and find a driver for it written in a C API and use the a code interface node.  If anyone knows a driver for a Prolific 2305 Bridge adapter that'd be the best way to go.
0 Kudos
Message 7 of 8
(8,448 Views)
Hey Ben!
Sorry I couldn't help you very much.  But you are correct parallel ports do not work on non Windows LabVIEW.  For your communication with USB, if the information I sent above didn't work, you should look for another API.  Again, Sorry ben.
Best Regards,
Song Mu
National Instruments San Diego
0 Kudos
Message 8 of 8
(8,419 Views)