02-18-2016 02:23 PM
@Michael.Koppelgaard wrote:I think I will buy 2 NI USB-6210, since I need 3 maybe 4 digetal input for 2-3 valves and 1 pump.
The sampling rate is lower 250 kS/s , instead of 400, but I guess the will be okay.
Am I right?
Price vs Cost. Buying "Extra" hardware that "Costs" a bit more has a far cheaper "Price" than trying to force the hardware to be used in a way it was not intended because of the savings in development time!
I have worked projects where the "Bean counters" said "Buy This Device" because it was $xxx.xx dolors cheaper. Then I spent a few hours developing a LabVIEW P-n-P Driver for the device since the available one was grossly flawed! The other option had a nice driver. At my hourly rate they lost a lot of potential profit on the project because of that choice.
02-19-2016 02:09 AM
I’m also very happy for the advice you gave med buying extra hardware
02-19-2016 03:08 AM - edited 02-19-2016 03:11 AM
I attached the example project as a zip file, version is LV 2014. Unzip it, and check how it works. Right now the lvlib is designed to work with 6 digital outputs, and the default setting for the AI is to DAQ 12 channels.
If you get a second USB hardware, half the AI and DO channels. I also put an example main VI into the project so you can see how to use the VIs:
I just programmed the resource module to use "on demand" data acqusition from the analog inputs, so use software timing in your loops when you use these subVIs (as i did in the example VI in the project).
The 4 public methods in the lvlib are:
edit: slight mistake with the second digital output level 🙂 Modify it in the zipped file! 🙂
02-19-2016 10:42 AM
I haven’t had a single minute today to look at your code and might not have it before Tuesday I’m afraid
02-21-2016 09:06 AM - edited 02-21-2016 09:06 AM
This is really great!!! Well organized I can see that. I’m not sure, I understand everything jet, but I will certainly try my best to understand and will also of course use it. I will try to correct my stateMashine next week and build your AE into it.
I hope I may return with the new code and let you (or somebody else, review it) for further corrections. Hope I’ll do better this time.
03-23-2016 05:34 AM
I have a question
I tried to build in your “set DO” and “Read” sub vi’s.
But when I do that, I get an error even though, I have run the init-vi beforehand.
What can be the reason?
03-23-2016 05:37 AM - edited 03-23-2016 05:37 AM
No idea, unless you show your whole VI with all the functions (Init, Read, etc...). Are you sure the Init happens BEFORE the Read?
If you make a test VI, like my snippet above a few posts before, does it produce error too?
03-23-2016 05:45 AM
I think you can pretty easy produce the error yourself. And I made an example in the 2 snippets attached. Very simple.
I had my LabVIEW trainer to look at the error, and he was puzzled and couldn’t explain the error. He had to think.
I checked that the resource module in your vi’s were the same and it was.
03-23-2016 05:47 AM
03-23-2016 05:47 AM
@Michael.Koppelgaard wrote:I think you can pretty easy produce the error yourself.
I can setup a virtual DAQmx device, and I will test it. I come back when I tested it.
And I made an example in the 2 snippets attached. Very simple.
No. You showed the two subVIs only. You did not show how you use my subVIs!!
I had my LabVIEW trainer to look at the error, and he was puzzled and couldn’t explain the error. He had to think.
Still thinking? 🙂
I checked that the resource module in your vi’s were the same and it was.