Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Binomial random numbers as digital outputs

Greetings.

I am using a PCI 6259 card with LabView 8. I would like to drive 8 solenoids such that the probability that any one solenoid is activated at each time step ( variable 10/20/50/100 ms) is the result of a binomial trial. So, at time step n (0<=n<=N, a large number), I would like to generate coin tosses and take the 1's and 0's to drive the solenoids. I have written some code to do this, however DAQmx generates an error saying the following:

Error -200565 occurred at DAQmx Write (Digital 2D U8 NChan NSamp).vi:1
Possible reason(s):

Specified digital channel contains more bits than supported by the 8-bit version of DAQmx Port Write.

Use the version of DAQmx Port Write that supports wider digital ports.

Minimum Write Size (In Bits): 32

I am attaching my code here. Kindly suggest the problems or alternatives to this code for runnin this task.

Thanks

Aniket
0 Kudos
Message 1 of 5
(3,496 Views)
Hi Aniket,

I ran your code as-is with both an actual PCI-6251 and a simulated PCI-6259, and I did not receive the error in either case.  Are you changing the default values of any of the controls before running the VI?

Regards,
Andrew W
National Instruments
0 Kudos
Message 2 of 5
(3,485 Views)
Yes, with the default setting on, it does execute without error. But if you change the waveform length, which I think should change the number of samples written to the task, the code runs into errors.
0 Kudos
Message 3 of 5
(3,472 Views)
Also, if I do not change that parameter, there is no output at all. And with it changed, the VI shows errors.
0 Kudos
Message 4 of 5
(3,472 Views)
I think there were just some problems in how you were building the waveform array.  Take a look at the modified VI and let me know if this works for you.

Regards,
Andrew


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