05-25-2011 08:11 AM
OK, I'm in the arduous process of rolling my own. Seriously, doesn't anybody use C any more? >.<
That said, I have been figuring it out, and now need to convert user-inputed commands into a binary output stream that will be fed over the JTAG interface.
Everyone (and I mean *everyone*) keeps telling me to use the waveform editor, to which I say "I have a 144 bit stream to push, and I'm not building 2^144th waveforms!"
So, mucking around with some other folks, we've come up with the "HSDIO Convert Binary to WDT" vi in LabView.
Unfortunately, there does not seem to be an equivalent function under CVI. Seriously, what the heck? How can I get the equivalent functionality?
...
Oh, and thanks for help.
05-26-2011 04:47 PM
tomii,
I know that it can be frustrating when functionalilty exists in LabVIEW and not in C. The JTAG Waveform library was created in LabVIEW using lower level VIs and LabVIEW functions and therefore is native LabVIEW. I have a few suggestions if you would like to use the functionality in C.
1. You can create C wrapper DLL(s) that allow you to call the LabVIEW functionality from C. This would allow you to use the already existing LabVIEW code. This tutorial explains how to create and call these DLLs in C: Can LabVIEW C? - Example 3: Using the Right Tools with LabVIEW
2. You can use the JTAG Library VIs (or the HSDIO Convert Binary to WDT) as a reference to create the functionality in C. After taking a look at the HSDIO Convert Binary to WDT function, it looks like the majority of the function is data manipulation via arrays and loops. The JTAG Library also seems to be a lot of data manipulation and could be constructed in C.
I also wanted to mention that you can reference all of the functions available in C for HSDIO via the Help. This is located at Start Menu >> All Programs >> National Instruments >> NI-HSDIO >> Documentation >> NI Digital Waveform Generator/Analyzer Help >> Contents >> Programming >> Reference >> C/C++ Reference. Similar Help documents are available for our other drivers and programs, such as LabWindows/CVI and NI-DAQmx.
Another good resource is the HSDIO C examples located at Start Menu >> All Programs >> National Instruments >> NI-HSDIO >> Examples >> c. There are a few that deal with WDT, such as the ReadHWSFileAndGenerateWDT.c. It might not be exactly what you want, but could help provide some guidance on how to use the available functions.
Regards,
Aaron
05-27-2011 06:17 AM
Honestly? Yeah, the help files are lacking, otherwise I wouldn't be spending so much time here, and on the phone with support.
Okay, I'm done bashing.
Got the waveforms figured out. The data representation in C help file is woefully horrible. It talks about data elements being 0, 1, Z, L, H, or X (0, 1, 2, 3, or 4, IIRC)... It had the support engineers and me fooled for a while. Turns out, you put together an arry of integer values (my card seems to want only UInt32), and the bits of each word are spread amongst the DIO pins in lsb order. That is, putting an 11 as the value (0x000Bh) would put the following on the DIO pins: DION -> 000000000...001011 <- DIO0
Now that this is figured out, I am working on having the exported sample clock re-imported on the clock in (or other) connector to use as a simultaneous acquisition, so I can verify the output bit stream.
06-15-2011 03:13 AM
Dear Sir
06-15-2011 03:24 AM
Dear Sir
Now I want to do Boundary Scan function for Altera FPGA by use LabVIEW.
I get the JTAG Digital Waveform library.
What kind of device can use this library?
Does "USB-6251" or "USB-8451" can use the libaray?
The library only generate the waveform for device but not use for device direct, right ??
If I have the adapte (usb download cable) that can use the library ??
Thansk you so much.
Best Regards
Richard.
06-16-2011 02:13 PM
RMT,
The JTAG Digital Waveform Library creates waveforms that can be used with any National Instruments hardware-timed digital I/O device (this would include the USB-6251). You can use the library directly with any hardware-timed digital I/O device. Take a look at the JTAG Digital Waveform Library article for more information about the features it provides.
If you would like to create waveforms for the USB-8451 for communicating over protocols like I2C and SPI, there are two libraries that allow you to do this:
- Inter-Integrated Circuit interface (I2C) - I2C Digital Waveform Reference Library (IDW component)
- Serial Peripheral Interface (SPI) - SPI Digital Waveform Reference Library (SDW component)
You can use all of these libraries in LabVIEW. I would take a look at those three links for more information.
Regards,
Aaron