LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interaction between two machines (systems) and creating one output data file

Hello, 

 

I am trying to build a common system which intereacts with two machines and outputs one common data file, This data file contains synchornized data from both the machines with respect to time stamps. 

 

Machine 1: This machine cannot be controlled in real time and outputs an excel file only at the end of each test. 

 

Machine 2: This 'system' is a setup which is a combination of pressure transducers and flow meters wired to a CDAQ. This system responds to directions from Machine 1. 

 

Goal: To output one common data file with synchronized data entries from both the machines. 

 

The output data can be played with only after the test is completed. i.e, any synchornization which can be done on the output files from both the machines can be done only after the test has been completed.

 

 

Can some one kindly share their insight into how this can be achieved ? 

 

 

Thanks in advance, 

RP. 

 

 

 

0 Kudos
Message 1 of 12
(2,827 Views)

Hi RandelPrandel,

 

It sounds like you need to use a shared variable. Take a look at the following articles. At least one of the options should work great for your application:

 

How Do I Set Up Shared Variables to Communicate Between Two PCs

How to Use Shared Variables and DataSockets to Pass Data Between Two Networked PCs

Streaming Data Continuously Between Two Applications

Using the LabVIEW Shared Variable

 

This should get you all set. Let me know if you have any questions.

 

Best,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 12
(2,779 Views)

Hi Jason, 

 

Thanks a ton for the reply. 

 

I did go through the shared variables for this application and they are really helpful. 

But the hiccup here is that Machine 1 does not have scope to install labview. It is not a computer - computer and has very limited memory.

It's essentially a very basic Windows 7 interface to publish results from the machine. Hence, the results produced in the machine are stored as a text file. ( The machine has two USB ports)

 

The ideal scenario here is: Machine 2( Pressure transducer/ flowmeter setup) responds to the functions carried out by machine 1. i.e, When machine 2 recieves a certain signal from machine 1, it activates the transducers within it to sense pressure at that specific moment in time and record it(CDAQ). Currently, the "certain signal" output is being recorded in a data file on machine 1 and the transducer output is being recorded in a data file on machine 2. 

The goal here is to combine both data files into one common file, which gives the transducer ouput from machine 2 at the respective singal acquired from machine 1. 

 

This leads to two questions: 

1. How can data be imported from the system as there is no room for installing labview..?

 

2. How can the two data sets from two different machines be synchronized (Even post-test will do) ? 

 

I think, this is both data acquistion and time stamp synchornization issue. 

 

I intially thought the time stamps could be synchronized in DAQmx with 6216 DAQ to CDAQ using a BNC cable. But after having known that labview cannot be installed on Machine 1, this rendered futile. 

 

Finally, is there a way the signal output file can be imported from machine 1(with no labview) in DAQmx (CDAQ) and then be synchronized later with the transducer output file from machine 2 post test? 

 

Any thoughts on this? 

 

Thank you. 

 

RP. 

0 Kudos
Message 3 of 12
(2,764 Views)

RandelPrandel,

 

Firstly, does Machine 1 have the capabilities of running LabVIEW Run-Time? If so, then you can write an executable for that machine and use THIS white paper to read shared variables with it.

 

However, if this is not an option, we should really distinguish what kind of synchronization you need. Are you reading your data to one computer (Machine 2) from the DAQ device? What happens on the 2nd machine that you need "synchronized?" You can always write to a file on a network and then pull that file off the network after runtime and use it on another computer? If you are really just sending a trigger, we can talk about changing serial commands along a USB port to a digital TTL pulse and triggering data acquisition through that, but it would probably require another device. If you have a digital pulse available, then we can route that over to the DAQ device and use that for synchronization. Otherwise, we can always use SW synchronization by pulling the timestamps off each computer and comparing them. If I could get a clearer idea of what is being sent between the computers, I could better address this question.

 

Best,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 12
(2,741 Views)
my initial idea is simply to read both files after test and merge them. That requires some network connection ofc. A labview program can watch for the result files from any pc and handle it post test.
Thing will ofc be simpler if machine 1 can run lv locally.
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 12
(2,734 Views)

Hi Jason, Yamaeda, 

 

Well, found out that LV can be installed on machine 1.  Smiley Very Happy

 

Now, mainly, Machine 1 creates a pressure profile and records it in a file (.txt). And simultaneously, Machine 1 gives signals out to the Transducers (Machine/Setup 2) as to when to actuate and when to stop. 

 

The goal is to have these transducer readings read in the same pressure profile file on machine 1.  i.e, One final output file with the Pressure profile and the transducer readings in it. 

 

 

I think this makes it simpler. Any thoughts on this? 

 

Thanks, 

RP. 

0 Kudos
Message 6 of 12
(2,698 Views)

RandelPrandel,

 

It sounds like you are on the right track. What kind of file are you looking to generate? Are we talking about a spreadsheet with one column pressure profile and one column transducer readings, with timestamps that match up? I suppose you could write to a database if this is the case. If I could get a clearer picture of what the final product should look like, I can better assess the best option for you.

 

Best,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 7 of 12
(2,670 Views)

Hello Jason, 

 

Yes, the file i am trying to generate is a spreadsheet with one column pressure profile and one column transducer readings, with the same time stamp(s).  I shall certainly look into write to database option. 

 

The final product would look like this, 

 

One spreadsheet with pressure profile, transducer readings and these readings taken only at respective milestones on the pressure profile. (No superfluous data)

Essentially, Machine 1 genenrates a pressure profile from 0 to 500 psi, per say. And on this profile, Machine 1 pauses for a given amount of time, say 30 seconds, at every 100 psi while ramping up and down for the user to manually note the pressure readings.Therefore, the goal is to automate the manual part and generate one final report (spreadsheet) where it's plug and play. 

i.e, 

1. User switches on the machine. ( This stays manual)

2. The machine ramps up from 0 to 500 psi while pausing for 30 seconds at every 100 psi. 

3. Data is acquired at only this 30 second interval. 

3. The machine ramps down from 500 to 0 psi while pausing for 30 seconds at every 100 psi.

4. Data is acquired at only this 30 second interval. 

5. A final report (spreadsheet) is created which "Explicitly"  furnishes every milestone reached on the pressure profile and it's corresponding transducer reading. 

 

I hope that gives a clear picture of what the final goal is. 

 

Kindly share your thoughts on this. 

 

Thanks, 

RP.

 

0 Kudos
Message 8 of 12
(2,664 Views)

RandelPrandel,

 

You could do this fairly simply by creating one spreadsheet on one computer with timestamp data in the first column and data in the second column, and another on the other computer with timestamp data in the first column and data in the 3rd. Then you could overlap the spreadsheets (append) on one of the computers and sort by timestamp (as long as they have identical looking timestamps). The problem with this is that you will have a lot of "empty" space since the two computers are not going to generate identical timestamps. It would be ideal if this were all completed on one computer, or at least if data was written to a network shared variable and all handled on one computer. Another option is programmatically parsing through all your data, but that would be extremely tedious. Let me know what you think.

 

Best,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 9 of 12
(2,636 Views)

Jason, 

 

Werd. That is the problem i foresaw initially, I thought i was going to have two files on seperate computers and then merge (overlap) both of them with lottt of empty 'rows' to deal with. 

 

But as i explained in my previous post, I don't have to generate two seperate files anymore as i can run LV on the Master machine (machine 1 -which generates the pressure profile) itself. 

So, i would be reading the transducers (setup/machine 2) on machine 1 itself and populating this data in the already generated pressure profile file, all on machine 1. 

 

I reckon, what i ideally should do now is ( All on machine 1); 

 

1. Read the transducers.

2. Read the already generated Pressure profile (.txt) file in LV. ( As i mentioned before, machine 1 generates an output file) 

3. Populate the transducer data in this pressure profile file on machine 1. 

4. Voila !! Smiley Very Happy

 

But i can't do this real time, as i have a CDAQ (or can i ? ). So, i would have to populate the transducer data in a seperate file, then access these two files and merge them post-test. That brings me to the time stamp question....

 

Conjecture: As the pressure transducers follow commands given by machine 1, i think the transducer data will be acquired with respect to the same time stamp as of the generated pressure profile. 
                 Am i right on this one? 

 

Does this approach make sense? 

 

I tried the programmatically data parsing option on python, but it proved to be tedious. 

 

Can you share your thoughts on how i can accomplish the aforementioned 4 steps? 

 

I don't really want to get into overlapping files. If there is way where i can simply read the pressure profile file and populate this file with transducer data dealing with just one file, that'll be really sweet. 

 

Please advise. 

 

Thanks,

RP. 

 

 

 

0 Kudos
Message 10 of 12
(2,630 Views)