01-17-2011 08:30 PM
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.
Solved! Go to Solution.
01-17-2011 11:39 PM
Hi cahrles.m
I am not able to open your code. Can you post it in LV2009?
01-17-2011 11:53 PM
Sure thing !
01-17-2011 11:55 PM
In case you were wondering I am using the NI 9178 and four 9481 relay modules.
01-18-2011 12:16 AM
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.
01-18-2011 12:22 AM
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.
01-18-2011 12:23 AM
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?
01-18-2011 12:47 AM - edited 01-18-2011 12:49 AM
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.
01-18-2011 01:25 PM
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 !
01-18-2011 07:54 PM
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:
Rgs,
Lucither.