From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous pattern input and output using 5 PXI-6534

I plan to use 5 PXI-6534 boards for a digital tester application. The first board will have 16 inputs and 16 outputs, the second board will have 16 outputs, and the other three boards will use 32 inputs each.

I have been looking at the “Simultaneous Pattern Output (using Onboard Looping) and Input with an NI 6534” example found at (http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3D87356A4E034080020E74861). My application is similar, but I don’t want the looping and I have several boards to synchronize.

I want to use the buffer memory on the boards and an internally generated clock. To synchronize the boards I plan to let the second board generate the REQ signal and pass it to the other boards via RTSI. I plan to use LabVIEW like in the example above. There are some issues I’m not sure about:

1. I have two boards performing output. When using DIO Start the output patterns are moved from buffers in the PC to the onboard buffers. When the buffer of the second card is filled the output operation starts and the REQ clock is transferred to the other boards via RTSI. But, how can I be sure that the onboard memory for the output group of card 1 has been filled when this occurs? Do I need to first do DIO Start on the output group on board one, then wait for a certain amount of time so I am sure the data has been transferred, and then do DIO Start on board2?

2. Are the buffers in the PC necessary when using the onboard buffers for output? I have the data I want to output in arrays in LabVIEW. When using DIO Write this data is copied to memory buffers in the PC. When I do DIO start it is transferred to the memory on the boards. Is there some way to skip the buffers in the PC and transfer the data directly from the LabVIEW array to the onboard buffers?

3. For the input channels data are sampled to the onboard buffer, then transferred to the buffer in the PC. I have written a DLL to compare sampled result with expected results and it wants pointers to where the data is stored. Can I get a pointer to the memory buffer or do I need to first transfer the data to a LabVIEW array before calling my DLL?

I currently do not have access to the boards, and any input is appreciated since I now need to design an interfacing PCB (with LVDS drivers and some level-shifters).

/LeifL
0 Kudos
Message 1 of 5
(3,156 Views)
Hello!

I will try to answer your questions as good as I can:

1) Your strategy seems to be correct.
2) Yes the buffers are necessary; the buffer created by the driver cannot be skipped.
3) No, you cannot get a pointer to the memory buffer so transfer the data to LabVIEW first and then do the comparison.

Cheers,
Jimmie A.
Applications Engineer, National Instruments
Regards,
Jimmie Adolph
Systems Engineering Manager, National Instruments Northern European Region

0 Kudos
Message 2 of 5
(3,120 Views)
Thank you for your answer. Here comes some additional comments/questions.

2. If I skip using LabVIEW and write my application directly in C/C++ (using the NIDAQ C-API) it seems like I don't need to do the data transfer from an array to the driver output buffer, since DIG_Block_Out takes a pointer to an array containing the data to be transmitted. Correct?

3. Like in 2) this memory transfer will not be needed if I write my application in C since I then already have a pointer to the buffer. Furthermore, as I understand it LabVIEW tries to avoid copying data in arrays and instead internally passes data by reference (pointer) when possible. But how does LabVIEW handle a call to a DLL where an array is used for input (and not for output). Would LabVIEW then create yet another copy of the data and call the DLL with a pointer to this new copy, or will it simply call the DLL with a pointer to the array?

Best regards,
/Leif
0 Kudos
Message 3 of 5
(3,110 Views)
Hello!

You will have more control over the buffers in C or C++, since LabVIEW is a language that handles pointers itself.
LabVIEW handles pointers itself and all optimization of the buffers is handled by LabVIEW and its memory manager functions.

Pretty much LabVIEW does the same thing as you would do yourself when programming C, and how you program your LabVIEW application determines how much data that is copied at a time.

Regarding the DLL’s and pointers to arrays I am not sure, I have to check that out for you.

Regards,
Jimmie A.
Applications Engineer, National Instruments
Regards,
Jimmie Adolph
Systems Engineering Manager, National Instruments Northern European Region

0 Kudos
Message 4 of 5
(3,100 Views)
Hello Leif!

Here is some information that might be helpful for you when it comes to arrays/DLLs and how LabVIEW handles this.

When talking about different parameters you can use when configuring the Call Library Node in LabVIEW you can use strings, numeric and arrays among other things.

There exists a few alternatives for arrays that you can choose between and these are:

• Array Data Pointer passes a one-dimensional pointer to the array data.
• Array Handle passes a pointer to a pointer that points to a four-byte value for each dimension, followed by the data.
• Array Handle Pointer passes a pointer to an array handle.

More information regarding this can be found here:
How Are Array Pointers Passed When Using Call Library Function Nodes?
http://digital.ni.com/public.nsf/websearch/AE789F386BF9C35B86256C95006F3A50?OpenDocument

What are the Differences Between "Array Data Pointer", "Array Handle", and "Array Handle Pointer"?
http://digital.ni.com/public.nsf/websearch/862567530005F09C8625649700587C37?OpenDocument

Integrating DLLs (examples and tutorials)
http://zone.ni.com/devzone/devzone.nsf/webcategories/E2A99E7E10D5725D862567AC004F0A53

An Overview of Accessing DLLs or Shared Libraries from LabVIEW
http://zone.ni.com/devzone/conceptd.nsf/webmain/B26A875ACA51C567862567CA0055FF24

Hope this helps!

Regards,
Jimmie A.
Applications Engineer, National Instruments
Regards,
Jimmie Adolph
Systems Engineering Manager, National Instruments Northern European Region

0 Kudos
Message 5 of 5
(3,090 Views)