LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital multiple input

Can anyone help me please, i have to make a VI and i don't realy know how. my homework sound like that :

It monitors three digital lines that represent states of the 3 engines used on a crane lifting weights. Crane height is 30 meters. read for a single rotations crane with a rotation sensor input from the analog input is -1500 +1500 rpm and -5 +5 V output range. Knowing that when you start the application, trained crane weight is on the ground and knowing the diameter of the drum (10 cm) that is wrapped cord drive, i have to display weight position  depending on the rotation and to order two alarms: one in case that the weight exceeds crane height and one in case the weight touches the ground, and i have to  save to a file alarm values.

 

0 Kudos
Message 1 of 15
(4,048 Views)

Hello Lonut,

 

It sounds like you need to be able to do three digital inputs and one analog input, and you need to save data to a file. There are examples in the example finder that show how to do this. I'll guide you to them below, and then you can combine the concepts from those examples into your final application and add the logic of your application.

 

In the event that you need help with LabVIEW coding in general, we have video tutorials for students for getting started:

http://www.ni.com/academic/students/learnlabview/

 

I'm not sure what hardware you are using, but I'm going to go ahead and assume it is DAQ. If you don't have DAQmx installed, you won't be able to find the examples below. If you are not using DAQ, please let me know what hardware you are using.

 

Analog input

First, open up the example finder (help --> find examples). Then navigate to Hardware Input and Output --> DAQmx --> Analog Measurements --> Voltage --> "Acq&Graph Voltage-Int Clk.vi"

 

Digital input

First, open up the example finder (help --> find examples). Then navigate to Hardware Input and Output --> DAQmx --> Digital Measurements --> "Read Dig Chan.vi"

 

Save to file

First, open up the example finder (help --> find examples). Then navigate to Fundamentals --> File Input and Output --> "Write TDMS File.vi"

Colden
Message 2 of 15
(4,016 Views)

I tried to do but not quite succeed. can you help me make it? have time until June 25 to make it and did not really have time to make it until then I have 3 exams

 

0 Kudos
Message 3 of 15
(3,997 Views)

Hello,

 

I can't write code for you - rather I can help direct you to the correct solution.

 

Were you able to get each example working individually? If not, what errors did you see?

 

If the problem exists in the integration of the programs, what errors are you seeing? I can give coding advice if you want to post your code.

 

What hardware are you using?

Colden
0 Kudos
Message 4 of 15
(3,993 Views)

I use simulated DAQ device. I'm going to try to make it tomorrow, although I do not know how to begin.

 

 

0 Kudos
Message 5 of 15
(3,990 Views)

Simulated DAQ devices output constant sine waves (for AI modules). They will not be very useful for doing any calculations because you will just get a constant sine wave back.

 

You should begin by going through each example I linked and getting each individual one working, then work on integrating those examples.

 

If you are not familiar with LabVIEW, you should begin by going through the ni.com/students/learnlabview tutorial.

Colden
0 Kudos
Message 6 of 15
(3,988 Views)

hello, can you hel me please...I tried to make the VI but I stuck around, first I do not know if i what i done is right and secondly do not know how to compare signal read from Analog Input and put those alarms. I did some calculations and crane can carry 95,541 rotations without having to turn the upper alarm on and the lower alarms starts when the weight is on the ground

0 Kudos
Message 7 of 15
(3,978 Views)

Hello lonut,

 

You currently have your VIs set up sequentially instead of in parallel. If you want your AI and DI to run at the same time, you should run the while loops in parallel, instead of waiting for the digital input loop to finish before starting the analog input loop. Also, you will need to input an analog input channel for your analog input task. Currently, the constant for selecting that channel is blank. You will also not need to feed the task configuration line from the digital input task into the analog input task - these tasks are completely separate and don't need to share configurations.

 

Have you gotten these VIs to work individually? If not, please try each one individually first (including the portion of the VI where you do the alarming).

 

With regards to the alarming, since you're reading from multiple analog input channels, you'll need to separate out those channels and handle each one individually (using "Index Array"). Then you can get the array of data values out using "Get Waveform Components". 

 

Finally, you should work through this developer zone article about "Getting start with NI-DAQmx": http://www.ni.com/white-paper/5468/en

It will really help you merge these VIs.

 

 

Colden
0 Kudos
Message 8 of 15
(3,971 Views)

Thanks for helping me. How can we put to work simultaneously? how to connect them?i  need to put in a single LOOP?

0 Kudos
Message 9 of 15
(3,967 Views)

Just put them in separate loops. They can basically be completely independent - the program will set up multi-threading and your processer(s) will execute the loops in parallel.

Colden
0 Kudos
Message 10 of 15
(3,963 Views)