11-17-2009 02:11 PM
Hi, John,
Thank you for your reply. About the labview problem, I have already disturbed you a lot, so I will try to find a new version first. If finally I can not find such a version, I will let you know.
Cheers,
Tingxuejh
11-18-2009 11:31 AM
Hi Tingxuejh,
I was actually able to convert the code down to LV 8.0, this should be what you need.
-John
11-18-2009 03:22 PM
Hi, John,
Thank you for the kind helps. I read the codes carefully, and it seems exactly what I need. Only I have several questions related to the code:
1) I'm not sure if the measurement and control of the integrating and resetting action is continously. In my opinion, the program stars from the left side and then goes into the while loop. However, I don't know whether the triggers or comparisons are still working when the while loop is operating. (If not, that means we can only creat and measure one integrating process.)
2) In your program, you used a sub-vi called "control task.vi" and you specified the action to "commit". I have checked the help document of this vi, however I still have no idea what does this vi do;
3) The same thing happens in the "start retriggerable property node". In my understanding, this node specifies that when this node receives one trigger, the counter will generate a pulse with the defined high time and low time.
In my case, I want the control signal goes to low when a trigger is received. Therefore, the high time has to be very small. Is that true?
4) Since the sampling process is very fast. I added a producer/consumer loop. The revised code is attached. Please help me to check it.
In this code, I used a sequece structure. Firstly, the channel under test is selected. Then, I set aside some delays to allow the selected channel to be settled. Finally, I started the integrating process;
5) I'm wondering what is the initial state of the counter0 output? If it is high, the integrating will start before I start to measure it.
Still a lot of questions, I'm sorry. Thank you for the helps and patience.
Cheers,
Tingxuejh
11-18-2009 06:11 PM
Hi Tingxuejh,
Great questions! Let me go through each one:
1. The control signal will trigger repeatedly since the Retriggerable property is set to true. The measurement is actually just going to poll the most recent integral time that is available. I was under the assumption
2. The Control Task.vi is actually something I left in by mistake (not that it would cause any issues). I had originally planned to retrigger the analog input task so the graph would be locked in place on the display. I decided against this since it would require a software-defined rearm and it sounded like you wanted to rearm quickly. The Control Task.vi explicitly commits all of the configuration settings to the device to cut back on the time it takes to restart the task. Again, since we're not restarting the task in software, the Control Task function is unnecessary.
3. The retriggerable property node is just telling the task to be retriggerable. This means that after the task starts, the counter output will retrigger every time an analog comparison event is received. The counter output line has been set to default high, so on the trigger input it will generate the low time first (this is the rearm time). After which it will generate a small duration of time high, then continue generating high (the default) until another trigger is input. The trigger is rearmed as soon as the low and high times have been completed, which is why I specified such a low value for the high time.
4. It looks like you have the right idea with the code--does it run correctly?
5. I didn't really think much about the initial state of the counter and how it affects your integrator--what's the max output of the integrator? Would it be a problem to let it rail at the beginning of the code? I think we can use an Arm Start trigger to start the whole process but I'll need to test this to make sure (I'm not by any hardware at the moment).
I hope this helps clarify a bit. Let me know if you have any questions about any of the above, I'll look into the Arm Start trigger as soon as I get the chance.
-John
11-22-2009 11:24 AM
Hi,John,
Thank you for your answer.
1. Since the control signal will trigger repeatedly, the measurement is repeatedly. Can I add one more producer/consumer loop to store the integrating time data? By doing this, I can have multiple results for each input signal which will help to minimize the system uncertainties. I have attached the modified code, please check it;
2. I have removed the control task.vi;
3. Ok, now I understand it completely;
4. Since my hardware is not ready completely, I was not able to test the complete code. However, for the producer/consumer loop I have made a test setup to test it, and it works fine;
5. It is no problem if we let the integrator rail at the begining as long as the control signal is retriggerable. So if we don't make any change to the code, the output of the integrator can be expected as the picture. Is that correct?
However, I'm wondering if we can set the counter output to low at the begining of the program. For instance, can I add a sequence before the integrating action. And in this sequence, we set the counter output to low. I'm not sure if this is possible. Even if not, the current code is enough for my application.
Thank you for all the helps.
Cheers,
Tingxuejh
11-28-2009 10:44 AM
Hi, John,
I made a test setup and tested the code. It works fine. At this moment, I didn't find anything strange. I think this solves my problem completely. Thank you for your help and patience.
Cheers,
Tingxuejh
11-30-2009 11:13 AM
Hi Tingxuejh,
Thanks for the update, glad to hear everything is working as expected!
-John