LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

valve control

Solved!
Go to solution

Hello wise NI people. I am trying to use the text file attached below to control a series of valves. After several tries, I keep getting  errors (200524,etc)   and when it does run the sequence is way off. I have an idea were I am messing things up but I need some ideas on how to fix it. I will appreciate any suggestions or references.

 

 

Download All
0 Kudos
Message 1 of 10
(3,548 Views)

Hi cahrles.m

I am not able to open your code. Can you post it in LV2009?

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 2 of 10
(3,520 Views)
0 Kudos
Message 3 of 10
(3,514 Views)

In case you were wondering I am using the NI 9178 and four 9481 relay modules.

0 Kudos
Message 4 of 10
(3,508 Views)

Hi charles.m

First of all, I simulated NI hardware that you mentioned. I am not able to use lines 0:7. Instead I can use lines 0:3.

It may not be exact solution, but can you try selecting lines0:3 ?

Also need to send data accordingly.

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 5 of 10
(3,499 Views)

Charles,

 

The way your text is formatted was causing an error. I took out the errors from your text and now reads in ok. 

 

I can see that you are taking the first column to give you your time delay. You are then getting the rest of the array from the 5th column? is this what you are meaning to do? This means that in each iteration you are trying to send a 1D array consisting of 11 booleans. I have never used this hardware, could it be that it needs to see a 1D array of 16 bits and this is the error you are getting?

 

Rgs,

 

Lucither.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
Message 6 of 10
(3,494 Views)

Can you explain problem statement? What you want to achieve?

I can see you are using first column for delay purpose. After that then there is data from B to Q (16).

How do you want to output it to relay cards?

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 7 of 10
(3,493 Views)
Solution
Accepted by topic author Charles.m

Hi charles,

As my earlier post, with 9481 module I am able to use only lines 0 to3. You had used "Dev1/port0/line0:7" which gives error "-200170" which says

"Physical channel specified does not exist on this device.".

As you said you are using 4 modules I assume you are using 4 lines of each module, in test file you have data of length 16.

I changed line syntax, it gives no error. See if this is what you want.

 

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
Message 8 of 10
(3,478 Views)

Thanks Lucither, the idea was to send a ID array of 16 booleans as suggested.The fix from gak is exactly what I needed.I will probably need to see the tutorials  on how to send data effectively. Problem solved !

0 Kudos
Message 9 of 10
(3,421 Views)

No worries Charles, glad you got it sorted.

 

Just a quick point to note on your vi. As you are writing to some hardware in a loop it is better to use a conditional terminal to escape in case of an error. I will attach the code i wrote when debugging your original code. This code also allows you to easily select rows of data that you want to send:

 

Valve control.png

 

Rgs,

 

Lucither.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 10 of 10
(3,398 Views)