Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Sensor Measurment

This digital write VI on the NI website---

 
I understand the procedure of running this VI....but one question.....
 
I see that I has a line input...which says one channel of all lines.... I have a 1 d boolean array of size 4....so what can I do to change the number of lines....which in my case is 4 lines....I want DIO0, DIO1, DIO2, DIO3.
 
What would be the procedure for that.
0 Kudos
Message 11 of 23
(4,442 Views)

SK0480:

A polymorphic VI is a VI that will perform different tasks based on your inputs. In this case, this DAQmx
Create Channel VI can either write to all lines using one channel or write to all lines using separate
channels based on your input.

"The array control is sized for 8 lines, if using a different amount of lines, change the number of elements
in the array to equal the number of lines chosen." You can see in that example VI that there are 8 booleans,
if you want to only write 4 booleans, delete any 4 of the 8 booleans. If you want to write 4 booleans
in your code, have only 4 booleans available to be written. The rule is simply that the number of lines you
select need to match the number of booleans you provide. I may not have understood your question, so

please feel free to elaborate if I missed anything. Have a good afternoon.


Tori W.

National Instruments
0 Kudos
Message 12 of 23
(4,430 Views)

Ok well here is the problem Iam having, I just added an boolean array of 4 lines and it gives me error saying that number of lines is 8 and the number of elements are 4.

 

attached is the VI

0 Kudos
Message 13 of 23
(4,425 Views)

SK0480:

You need to write to four lines, not an entire port that has 8 lines. In order to write to only 4 lines, you
need to specify that in the Lines terminal. Referring to this example again:https://decibel.ni.com/content/docs/DOC-11139.
To change this one to read four booleans to four lines, you would delete four booleans and instead of choosing
"Dev1/port0/line0:7" for the Lines input, use "Dev1/port0/line0:3".


Tori W.

National Instruments
0 Kudos
Message 14 of 23
(4,423 Views)

I really appreciate your help, you have been very helpful..

 

Do I also have to specify the device that Iam using this VI... or just the lines..

 

For example if Iam using NI ELVIS II,, do i have to select this.

 

For example when I double click on the digital output icon in this VI... Do I have to create task in..

 

Thanks

 

0 Kudos
Message 15 of 23
(4,418 Views)

I really appreciate your help, you have been very helpful..

 

Do I also have to specify the device that Iam using this VI... or just the lines..

 

For example if Iam using NI ELVIS II,, do i have to select this.

 

For example when I double click on the digital output icon in this VI... Do I have to create task in..

 

Thanks

 

0 Kudos
Message 16 of 23
(4,418 Views)

Ok I've been trying this Digital Write Vi in my program, the program does not give me any error but when I test it using the 

LEDs at the Digital port, the LEDs do not turn on... 

 

Iam using NI Elvis 2, and I need to know how should I test it using the LEDS

 

Attached is the VI where Iam using this digital write

 

 

Thanks

 

 

0 Kudos
Message 17 of 23
(4,409 Views)

Hello

 

Iam trying to use this digital write which I found in the NI website https://decibel.ni.com/content/docs/DOC-11139 as I previously mentioned.

 

The question I have is if Iam using an NI Elvis II.... will I specify this device by double clicking on the digital output vi...or do I just to provide the lines only where Iam writing my data to. The reason I asked is because when I double click the digital output, it has options to select the task and digital lines...so will I need to select my devices or just specify the lines...

 

Also, I wasthe Test panels in the Measurement and Automation explorer to test the digital output lines...Now to test the signal what I did is that I change the digital lines high and connect the LED to it...but the LEDs do not glow...what could I be doing wrong in here.

 

 

Regards,

Shaham K

 

0 Kudos
Message 18 of 23
(4,397 Views)

SK0480:

I have already answered your question about what you need to specify to write to your lines. If you simply
designate which lines to use like I mentioned above, you do not need to import a task in. If you leave
the task in terminal blank, that VI will create a new task based on the rest of your DAQ task VI's
- like timing, read/write, and close DAQ task VI's. I not clear on your problem with the LEDs, when
 I run your code and hit the Start switch, your LEDs turn on. You are not getting any unexpected
behavior. As far as operating MAX test panels, you can find a tutorial on how to operate test panels here.
Have a good day.


Tori W.

National Instruments
0 Kudos
Message 19 of 23
(4,391 Views)

I am using a simple incremental quadrature encoder which has three inputs A, B, C....and does not have a Z terminal to it..

 

Iam using an NI ELVIS II and iam using one of the counter in the Elvis because the elvis board has two built in counter CTR0 and CTR1...and the Counter i see in Elvis has three terminals Source, GATE ,OUT.

 

Now I was reading the encoder measurement guide in the NI website, it says connect terminal A of the Encoder to the Counter Source and B to the UP/Down terminal of the Counter....

 

the problem i seee is that the counters in the Elvis do not have the up/down terminal so where should I connect the terminal B of the encoder.

 

0 Kudos
Message 20 of 23
(4,386 Views)