Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

VBAI 3 to read data from a LabView exe program

Hello,
 
I am connecting an encoder to a PCI-6601 I/O Board.  An EXE program developed by LabView 8.0 is reading the encoder.  Every time I trigger the camera I also trigger the Encoder program and store the data to the hard drive.  I then analyze my camera data in Vision builder 3.0, and by means of a vi, I read the saved encoder value from the hard drive.  Here is my problem.  I only have about 500ms between each measurements, and with all that hard drive access I lose some measurements once in a while.
 
How do I get data from the EXE program to Vision builder without using the hard drive?
 
I looked into labView's global variable, but it looks that it can not transfer data outside the exe program.
 
any help is greatly appreciated.
 
gert
 
0 Kudos
Message 1 of 10
(4,709 Views)

Gert,

    If you have Vision Development Module all of this can be done in LabVIEW.  But it sounds like you may not have it.  I do have some questions about how this setup is working.  Are you running the executable manually?  Why are you using an executable and not just a VI?  Also, how are the two calling each other, is the exe opening VBAI for processing?  How are you saving the encoder data?  If I can get a better idea of how your application is running I can help set it up to run more quickly.  For instance if you have it so that VBAI can call the exe, then you can have VBAI call the exe again to access the information perhaps in a variable, or leave the exe running.  Thanks!

-Allison S.

Applications Engineering

-Allison S.
Calibration Services
Product Support Engineer
0 Kudos
Message 2 of 10
(4,676 Views)

Allison,

You are correct, I do not have the Vision Development module.  I am using LabView Pro 8.0

The executable is running as soon the PC starts up.  (It is called in the start menu).

I am using an incremental encoder, so it has to be read all the time.  Every time that I need to read the data, I hardware trigger the executable, that then store the present encoder value on the hard drive in a file called "EncoderData.txt".  At the same time I also trigger my camera.  Shortly after a VI in Vision builder read the "EncoderData.txt" file.

gert

0 Kudos
Message 3 of 10
(4,662 Views)

gert,

    Being that the program that's picking up the encoder value is an exe that needs to continue running, and it seems that you need to be grabbing the image at the same time as the encoder value, I'm not seeing another option.  You could use call VI steps to immediately read the encoder value once you start processing the image in VBAI, but that would be delayed.  As far as I can tell right now this may not be possible without Vision Development Module because of the the need to communicate between programs because of your need for both.

-Allison S.

Applications Engineering

-Allison S.
Calibration Services
Product Support Engineer
Message 4 of 10
(4,650 Views)

Allison,

If I understand you correct, there is no way that I with LabVIEW pro that the executable can write data to a RAM location or variable, that a VI in vision builder can read.

gert

 

0 Kudos
Message 5 of 10
(4,642 Views)

That's right GertSc,

exe are allocated their own memory space to work with and can not read from other memory spaces.  The only sollutions are to create a dummy TCP read a write, write to a file that is read by the Vision Builder vi, or combine the functionality of the exe into the Vision Builder step (which you have stated you do not want to do)

Sorry we can't help further 

AdamB

Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 6 of 10
(4,631 Views)

Hello again,

Thanks for all the answers,

I still have a couple of questions.  (somehow I have to get this resolved)

1.  How do combine the functionality of the exe into the Vision Builder step (I do not know when or how I said, that I wouldn't do that?

2. In the first response it was mentioned to use the "Vision Development module".  What will that do for me?

best regards,

gert

 

0 Kudos
Message 7 of 10
(4,577 Views)

Hi Gert, one way to exchange data between your application and Vision Builder AI consists in using Modbus registers. You can configure Vision Builder to run a Modbus Server. Your application will act as a Modbus Master device and read/write values to the registers. You can find a set of Modbus VI to implement the master part at the following location: http://zone.ni.com/devzone/cda/epd/p/id/4756

 

 

On the Vision Builder AI side, go to the Tools>>Communication Manager and configure a Modbus TCP master device. Then start the Modbus Server. Then you use the Modbus Slave step to read/write values from the Modbus registers and use them in your inspection. You can monitor the content of the Modbus registers by selecting Tools>>Modbus Local Registers Monitor.

 

For more information on Vision Builder and Modbus, you can refer to this application note: http://zone.ni.com/devzone/cda/tut/p/id/4724

 

Hope this helps,

Nicolas

0 Kudos
Message 8 of 10
(4,562 Views)

 

Hi Nicolas, thanks for your answer.

I tried to use DataSocket, but that is slower than using the hard drive.  I also increased my memory, that seemed to help a little.  How is the speed using the Modbus compared to DataSocket?

gert

 

 
0 Kudos
Message 9 of 10
(4,484 Views)

Hello gert,

I would assume that the latencies involved with both are similar, but I have no specific benchmarking data for you.

It sounds like you have your system up and running but let us know if you have any other issues.

 

Regards,

Jasper S

0 Kudos
Message 10 of 10
(4,451 Views)