10-27-2010 09:11 AM
Hi,
no you're not right in thinking that. That would be silly. (forgive my sarcasm)
I have two seperate items, one is a load unit the other a USB logger, i want to send a software command to the load unit (to turn off) then log some voltage data.
The thing is that i want to catch the data as the load unit turns off, so i need to send the "off" command at the same time as i log the data.
10-27-2010
10:07 AM
- last edited on
07-10-2024
09:11 AM
by
Content Cleaner
Hi,
I was hoping that I had got it wrong because that did sound silly!
What I would begin to suggest is using notifiers for this.
It sounds like a complicated matter, it would help if you could send in some sample code for us to look at.
Regards,
10-27-2010 10:19 AM
Hi John,
the whole project was posted on the previous page.
(i had to add .jpg to the end as its a .rar and the forum doesnt like them, but just delete the .jpg and open it)
Cheers, Zac.
10-27-2010 10:37 AM
I've just tried changing the way i log the data,
I've set it to continuously aquire data, so i can:
1) Start the task (aquiring data)
2) Turn off the load
3) Stop the task.
4) write data to file.
5) sit back and bask in the glory of a file full of usefull data.
Instead it just came up with a DaqMX error, saying "the resource "INT" is reserved". (INT is the name of the daqmx task i created for this !
Attached is a pic of this part of code.
Cheers, Guys
10-28-2010 05:43 AM
The reason you are getting an error is most likely because you've put your DAQmx Read VI in a loop without setting up all the paramters for continous acquisition. You can keep your Sample Mode as Finite (as you previously had it) and wire it as in diagram Software Synch attached. I have just created a VI instead of your DLL as I didn't have access to that to show you how to connect the error wire. This set up will create two seperate threads so hopefully you'll be able to catch the data that you need.
For future reference I would recommend that you try to use local variables as sparingly as possible. Instead you can use a shift register in the example that you sent, see attached Shift Register example.
10-28-2010 06:23 AM
Thanks for that i will give it a try,
What is the yellow box that combined the two error wires before the MSG, and where do i find it in the pallete ?
Thanks,
10-28-2010 06:27 AM
It is the Merge Errors function. You can use this to combine your errors for processing. In your Functions Palette navigate to Programming -> Dialog & User Interface -> Merge Errors
10-28-2010 08:22 AM
I tried the example you gave, it didn't work. the file it created was empty.
See picture for code.
10-29-2010
05:03 AM
- last edited on
07-10-2024
09:11 AM
by
Content Cleaner
We need to identify why there is no data logged to file. A good debugging method would be to place indicators where you have data coming out to ensure you are actually producing the right information. For instance place an indicator on the Data output of your DAQmx VI:
- Right click the data terminal of DAQmx Read VI
- Choose Create -> Indicator
If you can see the data on your front panel and not in the file then there is a problem with how it is being logged. Try just creating a simple path for your spreadsheet file and logging the data. You can do this by right clicking the file path input to your Write To Spreadsheet File VI and creating a control for it. If you can log data using this method then it is your logging to file code that is causing the problem.
If you can’t see any data from DAQmx Read VI data indicator then there is something wrong with your DAQmx set up.
Can you try configuring your channels on the block diagram so I can see what parameters you've chosen. I have attached some example code for this. To run this code you first need to choose which Physical Channel you want to acquire from then click run. Also in the first VI choose what type of signal you will be sampling, I've just set it to a voltage signal but you can change it as you need.
You might find this link useful: https://www.ni.com/en/support/documentation/supplemental/06/getting-started-with-ni-daqmx--main-page...
10-29-2010 05:09 AM
Thanks, can you post the code as a picture as i'm running labview 2009 and it won't open your V10 example.
Thanks, Zac