06-06-2011 08:32 AM
I am trying to automate some hardware testing over the CAN bus. I have started a basic VI that I can manually run these tests, but there are testing scripts available to me and I was wondering if there is a way to import some sort of scripts (or similar) into LABView to automatically run my VI to perform the test. I've done some searches, but looking for scripting only comes up with MathScript that MATLAB related information.
Thanks for the help.
06-06-2011 08:49 AM
@stupidlogic wrote:
I am trying to automate some hardware testing over the CAN bus. I have started a basic VI that I can manually run these tests, but there are testing scripts available to me and I was wondering if there is a way to import some sort of scripts (or similar) into LABView to automatically run my VI to perform the test. I've done some searches, but looking for scripting only comes up with MathScript that MATLAB related information.
Thanks for the help.
You need to specify what kind of scripts are available for you to play with. If the scripts are in any other programming method(Python,dspace),then you
might have to re-engineer those scripts into LabVIEW readable format(excel, word) or you can call them in your as a DLL. If the scripts are in LabVIEW itself, you can directly call them as subvi
and run the execution after replacing redundant port access and file operations. Probably you can attach a sample script here so that others can view it
and provide you suggestions.
06-06-2011 11:47 AM
They are in excel and written for dspace machines. What would be the easiest way to integrate those into my VI?
06-06-2011 11:27 PM
If I am correct, the format of the excel sheet would be like:
The typicl script would be of something similar to above shown format. Can you confirm that ? If thats the case, I have some good suggestions for you as I have done it before.
06-07-2011 07:19 AM
I don't have one in front of me at the moment, but I recall it being pretty darn close to your example. I'd really appreciate your suggestions. Thank you.
06-07-2011 08:06 AM
@stupidlogic wrote:
I don't have one in front of me at the moment, but I recall it being pretty darn close to your example. I'd really appreciate your suggestions. Thank you.
I had a an excel sheet based automation system for one of the CAN based hardware.In that one, each row was my test step. The colomns of the excel based script was subdivided into input conditions and output conditions(from hardware point of view). The input conditions were again sub divided into Input Lines - CAN,Analog In,Digital In - which will be simulated by NI hardware. Similarly output lines will be read by NI hardware in Output colomn subdivision.
All the periodic signals will be kept with default values for each row (test step). Your LabVIEW automation program should read this excel script and process accordingly.
My automation script had almost 6000 rows and 150 colomns and later it became very difficullt to analyze the result. I would suggest you to explore the possibility of TestStand if your scripts require significant complexity. After learning teststand,I came to know that I could save lot of my sleepless nights. 😉
06-07-2011 09:25 AM - edited 06-07-2011 09:30 AM
Thank you very much for the help. To be honest, I'm new to LabVIEW development and so I don't have any experience in importing scripts whatsoever. Assuming I have the script written in the suggested format...
Do I keep it saved as a .xls?
What subVI block do I import it into LabVIEW with?
Also, I haven't looked at every script I'll be dealing with (only a couple) and therefore, I don't know how complex it may get. Do you know where I can access some resources on learning to use TestStand? I've never used it before. Even just answering the basic, what does it do/how does it work would be helpful.
Once again, I appreciate all the assistance.
06-07-2011 11:09 PM
@stupidlogic wrote:
Thank you very much for the help. To be honest, I'm new to LabVIEW development and so I don't have any experience in importing scripts whatsoever. Assuming I have the script written in the suggested format...
Do I keep it saved as a .xls?
What subVI block do I import it into LabVIEW with?
Also, I haven't looked at every script I'll be dealing with (only a couple) and therefore, I don't know how complex it may get. Do you know where I can access some resources on learning to use TestStand? I've never used it before. Even just answering the basic, what does it do/how does it work would be helpful.
Once again, I appreciate all the assistance.
We may be calling it as script,but to the core,you are developing an appication to read excel sheet,your logic should segragate each steps action and you should have LabVIEW code wherever an action is required. If you are planning to do this task in LabVIEW, you need following steps to finish.
In case you are using TestStand, you need go for an architecture where your CAN periodic data transmission is taken care using LabVIEW.
Honestly it's not the task of a novice LabVIEW\TestStand programmer if you have less time ro learn. If you provide your e-mail address, I can send you a scaled down code after removing proprietary stuff.
Following link is an introductuction to Teststand:
http://zone.ni.com/devzone/cda/tut/p/id/6073
Regarding availability of resources to learn LabVIEW and TestStand,Can any one who is following this thread can suggest any materials ?
06-08-2011 07:09 AM
I sent you a a PM with my email.
I'll also try to do some searches for some more information about TestStand when I get a chance. Once again, I appreciate the assistance.
06-13-2011 07:14 AM
After working through some things last week, I found that TestStand (although powerful) wouldn't be the ideal way to go for me. So I'm at the point where my excel scripts are imported and after a few array operations, formatted so that each instruction is in a row in an array in LabVIEW. Now I need to build the state machine. At first glace, I've been unable to find an easy way to create one from my list of instructions.
My first thought was to use a case statement with an enum and populate the enum with all of my instructions. The thing is, is the only way I know how to populate an enum is by manually entering in each state. This obviously would defeat the purpose of importing the excel script. Since you've done this before, how did you get create the state machine from your instruction list?
Once again, thanks for the help!