LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronise 2systems using battery in Labview

Hi;

I wrote a program in Labview which can collect data from Serical port and save it in a file.

Simulteniously, I used another system to collect the same data.

I need to synchronise these two systems.

By triggering a voltage like 9 volt I can point to start of collecting data; how can I do it for labview?

Let me explain more about my labview program:

  1. it has two channel for serial port
  2. Both channel are identical , i just collect different data from each port.
  3. The out put of each seril port are 3 data

so now, i am thinking, that while I collect each data (3 of them), I can add an external battery so when I turn on the battery (High ), it shows the trigger of starting point. Then easily I can synchronize my two systems, right?

 

I know that I can have power supply in labview. I am kinda confuse to doing this task, could you give me an idea?

 

Thanks;

0 Kudos
Message 1 of 8
(3,088 Views)

You lost me on what you are trying to do.

 

You talk about two systems.  And you talk about two channels for serial port.  You talk about "each port" which implies more than one port.

 

Your VI shows two separate, but identical sets of code, each configuring a VISA serial resource and reading from it.  But your front panel has both VISA resources set to Com1.  Are you trying to read from Com1 in two different places?

 

Can you draw a picture has to what is connected to what?  What is the "system", what ports are you using, and what are the channels that are "two channels for serial port".

 

Where does the battery fit into this scheme?  What are you connecting it to?

 

And then you mention a "power supply in LabVIEW".  What power supply?  Is this related to the battery or something different?

 

 

0 Kudos
Message 2 of 8
(3,084 Views)

 

Sorry, i tried to answer u step by step:

 

You talk about two systems.  And you talk about two channels for serial port.  You talk about "each port" which implies more than one port.

Imagine that I am measuring the location of subject using two sensors, so my data is  from sensor  1 is (x1, y1, z1) and sensor 2 is (x1, y2, z2). Using  Labaview, from port 1 I got information of sensor 1 and from serial port2 I got information from sensor 2. AND then using simple calculation I subtract these two outputs (x1, y1, z1)- (x2, y2, z2)(which I don’t care of this part). In labview, I saved data in a Excel sheet, with three columns of x, y, z.

Note: (x1, y1, z1)- (x2, y2, z2) are strung, I used match pattern to separate x1 from y1 from z2. And then concatenate them to have each of them separately in the Excel sheet.

Another system (called vicon) simultaneously should calculate the same data for me (x1, y1, z1) and (x2, y2, z2)

I want to synchronize the measurement of these two systems, I hope this time I explain better.

So imagine these two system measuring the data, how can I know when is the start point of both systems. So by saying START. Such that applying 10 volt voltage, I can trigger in both software that we have another measurement for voltage. All the time it is zero till I trigger the output voltage. So now in the Excell sheet I have another column for measuring voltage. And I can figureout when these two system are synched.

 

Your VI shows two separate, but identical sets of code, each configuring a VISA serial resource and reading from it.  But your front panel has both VISA resources set to Com1.  Are you trying to read from Com1 in two different places?

 Every time for measurement I set the different Com port. Since I attached it, you saw the default com port, which is wrong so don’t confuse please.

Can you draw a picture has to what is connected to what?  What is the "system", what ports are you using, and what are the channels that are "two channels for serial port".

 

 

 

And then you mention a "power supply in LabVIEW".  What power supply?  Is this related to the battery or something different?

I mean for applying  10 volt voltage, I need to use external voltage either using power supply or battery. I know that by adding VISA for power supply, I can communicate with external power supply which I need to connect it through cable, or using a battery which I don’t have any idea of possibility (if you know please let me know).

 

Does it make sense now?

0 Kudos
Message 3 of 8
(3,077 Views)

Are these two sensors outputting data continuously?  Your code just reads from the serial port.  It never writes out any commands such as a quest for data.  If you are just reading data, isn't the data you are receiving the most recent and virtually synchronized?  I don't know why or how the application of a voltage to your sensors causes it to take a reading.

 

You can certainly communicate with a nice power supply using a parallel loop that communicates with the power supply through a third serial port.  If you want to use a battery, which is probably a less expensive way to go, you could a digital output data acquisition card to drive a transistor circuit or a relay to turn the battery on and off.

0 Kudos
Message 4 of 8
(3,070 Views)

Yes; Data coming continuously.

Using the voltage is just a sign between two systems. So by turning on of the voltage, I can find where is the start point of both systems (imagine both are measuring).

I didn’t get you. Why I need to give voltage through the third port? And could you explain more about the battery?

 

0 Kudos
Message 5 of 8
(3,064 Views)

@SBk wrote:

Yes; Data coming continuously.

Using the voltage is just a sign between two systems. So by turning on of the voltage, I can find where is the start point of both systems (imagine both are measuring).

I didn’t get you. Why I need to give voltage through the third port? And could you explain more about the battery?

 

You said "I mean for applying  10 volt voltage, I need to use external voltage either using power supply or battery. I know that by adding VISA for power supply, I can communicate with external power supply which I need to connect it through cable, or using a battery which I don’t have any idea of possibility (if you know please let me know)."

 

If you are using an external powersupply that wyou want to talk to with VISA, aren't you going to need another serial port to talk to it?  And you said you might want to use a battery.  So I was giving you a way for the PC to be able to programmatically turn the battery on and off in the circuit.

 

I still don't understand what you are trying to do.  If the data is coming continuously, then just read in from both serial ports.  Why do you need to turn on and off the power supply to synchronize them?  How synchronized do you need the data to be?  At the second or fraction of a second level?  Or do you need down to the millisecond level? 

 


 

0 Kudos
Message 6 of 8
(3,054 Views)

Is there any way to chat?

I guess we can discuss easier.

 

I think for communicating with power suplly we dont need a port through the cable (http://www.designworldonline.com/articles/6591/256/Tips-on-Connecting-LabVIEW-to-Industrial-Networks...) please scroll down u will see the connector, we can communicate with any external instruments just we need to install drivers.

 

 

0 Kudos
Message 7 of 8
(3,052 Views)

No.  There is no chat method.

 

The cable you show in that link is a USB cable to communicate with an NI device that looks like it connects to a Foundation Fieldbus network.  Now you are going on a completely different tangent.

 

Do you have any colleagues who are familiar with your project?  It would probably be best to chat with them to sort out what you have and what you are trying to accomplish.  Figure out what the architecture of your system is supposed to be.

 

Then if you have any questions specifically related to LabVIEW, then post back here and ask them.

0 Kudos
Message 8 of 8
(3,049 Views)