04-16-2018 01:48 AM
Unfortunately the driver I downloaded does not work and I cannot find a working one. From just looking at the vi I cannot see the parameter you want to tweak, I assume there is a configuration VI in the driver to do so. But that is just educated guessing...
04-17-2018 05:21 AM
04-17-2018 06:05 AM
@oswes wrote:
- How do I adjust the capture frame on LabView data acquasition. By extending the scale does not help me capture more data.
Looks like this is highly RIGOL-dependant. I don't know their oscilloscopes. Were you able to manually configure the 1054Z to give you the results you want? As far as I can see in the driver project, everything(?) can be configured from LabVIEW as well.
Are you maybe searching for the "Configure Timebase.vi"?
The way you set up the trigger looks good to me, but I am not sure what you want to achieve with the Event Structure in your VI.
04-17-2018 07:55 AM - edited 04-17-2018 07:59 AM
Hi,
Thank you so much for all the help. I am getting closer to the goal. Now I want to store the values when the TRIGGER-condition is met.
I put the trigger on ":TRIGger: SWEep NORMal" but the loop starts anyway and print to the file. It doesnt matter if it is triggered or not.
How can I solve this? It should not print to the file when the trigger-condition is not met.
Something like:
if (:TRIGger: STATus? == TD)
print to file
else do-nothing
Best Regards
04-17-2018 08:12 AM
From just looking at your code it looks quite good. What you implemented is the same structure a DAQmx acquisition task would look like (that's the NI driver for NI hardware). I don't know how RIGOL expects us to use their driver, I can just assume they use the same model. Do you have any documentation from them?
Generally, I'd try the same: Set up the channel, configure a trigger, start the channel, and then read it's results in a loop. The (hardware) trigger will make sure the read operation inside the loop halts until the trigger happens. I noticed one thing, maybe it has to do something with your issue: There is a VI inside the driver that can set the Trigger sweep to normal. Maybe you could use that instead and check what happens:
There is also a minor flaw in your code, but not connected to this problem: Your code will never stop as the loop runs forever. It will just hang and wait for more triggers. As your VI never closes the reference to the DS1054Z (the DS1K Close will never be executed) this could lead to other problems.
04-17-2018 09:37 AM - edited 04-17-2018 09:38 AM
Hi again,
Fixed your feedback 🙂
I am pretty close now. The thing that is not working is the comparison between two strings. I can see that teh READ-function sends "TD" as a string. I compare it with "TD"...but still it sends my case-statement into FALSE.
The VISA READ and WRITE dedicate ports for #bytes written/read. Even thou I force it to read exactly nubmer of bytes written... it stills goes into false state.
Any suggestions?
04-17-2018 10:07 AM
First you don't want to force the VISA Read to use the number from the preceding VISA Write, the number of byte from the VISA Write is just a check to make sure the instrument received all the bytes it should have.
Don't set the VISA Read bytes to the exact number! For reading from the instrument you want to read as many characters as the instrument will return. Also its good practice to specify something much bigger (like 5x) what you expect for the number of bytes in the VISA Read. Its just pre-allocating a bit of memory and you don't want to under allocate or the string might be truncated in an odd way.
Now examine the string. If it looks like "TD" but doesn't select the right case there might be a space or LF or CR or other characters non-display characters at the end of your strings. Try looking at the string with the string indicator set to "\" Codes Display. If there are extra LF or CR characters in your string then use the "Trim White Space.vi" to remove them before the string is passed to the Case structure.