I am quiet new in using the PicoScope 2207 in Labview and I have some problems in creating a signal to GEN-Channel of the device.
I have tried to use the PicoScope2000aExampleAWG.vi but it doesn't really work in my case.
Ok, I managed it to put a signal on the GEN-Channel. There was simply a problem with the voltage.
I have tried to combine the stream and AWG.vi now, but it didn't work.
I would like to put a signal to the GEN-Channel, stream the "response" of my ultrasonic sensor on the A-Channel
and set the GEN-Channel as a trigger. After that I should get the time my ultrasonic need to get to the object.
thanks for your reply.
I will try to explain my problem more concrete.
I have an ultrasonic sensor that can send an ultrasonic impulse and detect the impulse when it is thrown back by a wall for example. Betwenn sending one impulse and receiving it back from the wall there is a time difference.
This time difference delta_t multiplied by the speed of an ultrasonic wave gives me the distance between my sensor and the wall. It workes fine with PicoScope6.
So, the steps I would like to realise in Labview are:
1) Sending an impulse (2V with 500microseconds pulse width with 20Hz) on the GEN-Channel of the Picoscope
2) Trigger that impulse
3) Stream on the A-Channel the "answer". So that I can see how long my sended impulse takes to go to the wall and come back.
If I have that time difference delta_t I would be soooooo happy
I have tried to fix my previous Vi.Now I am able to send an impulse and I can see on the chart the answer
but I don't know how to implement the trigger so that I can get the time difference delta_t.
The PicoScope2000aGetStreamingValues.vi can return values about the trigger for example which section of data it occurs and where it occurs in that section of data. Please note the triggeredAt value is the number of samples from the start index not the index value.
yes, I am outputting constantly with the signal generator.
Your link is a good hint and you are right, that the idea of measuring the amount of samples could be better.
How can I display the signal that I put on the GEN-Channel? So how can I read that channel to get the number of samples from the start when the rising edge starts on the GEN-Channel?
I have responded via your e-mail support request - below is excerpt for the benefit of other Users:
I suggest calling the following functions/sub-vi blocks:
1. PS2000 Open
2. PS2000 Settings
3. PS2000 Wrap Settings
4. PS2000 AWG
5. PS2000 Stream
6. Call ps2000aSigGenSoftwareControl with the state parameter set to 1
7. Loop (as you currently have it but add an output for channel B)
8. Call ps2000aStop
9. PS2000 Close
For the AWG, you just need to configure the settings to output 1 shot on a software trigger with the desired frequency setting. You can use the csv file as the sub-vi will convert the values.
I would suggest splitting the signal generator output using a BNC T-connector so you can then view the output on Channel B and send the signal to your sensors.
Once you start streaming, you need to keep track of the number of samples collected (which the example does). When the trigger event occurs, you simply need to know the total samples collected previously plus the number indicated by the triggeredAt parameter which you can find via the PS2000 Get Str block. Please note that the index value is zero based.
thanks for your reply. With your support my program is working now.
Your hints were just great.
I have connected a BNC T-piece between my AWG-Channel and Channel B so I can display what I am currently generating.
Now I can trigger my signal what I am getting on channel A so that I can calculate the time between sending the signal and receiving a signal that is for example reflected by a wall.
I am using that to get a precise prosition of an object that is moving on an assembly line.
The precision is abot +- 2mm but that is normal according to the sensor type.