LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI server method

After a bit of prying,

It turns out that the method they used originally to "capture" the image from the application was not guaranteed to work on this system. It was one of those things that might work but not guaranteed to work. This same feature is being used in another facility on 2 exactly the same machines, one works the other doesn't. Another process has to be developed as this option is not working, but as mentioned it was not something that was suppose to work, we just got lucky.....

 

The application itself works perfectly.

I can manually save the image and move/replace the JPG to the secondary machine, however I don't want to stand there 24 hours a day when production fires back up.

I am not trying to recreate the issue in LabVIEW, just trying to use the method that was recommended by the OEM of the application.

 

The information provided by the OEM is probably enough info for a seasoned labVIEWer, but my limited understanding is preventing me from gaining any ground.

 

From what I have gathered, I am not bypassing the viewer program and processing the data from the flexRIO card, just automating the controls of the application via VI Server.

 

Here goes my limited through process

Step 1.) Run at start up

Step 2.) Listen for tcp connection to be established

Step 3.) Once connection is made.

Step 4.) Every 2 sec, "click" the Save button in the application.

 

Rinse and repeat, never stop.

 

Once I get this working, I can expand on controlling the file name, data type, and location within labView and pass these settings to the application.

 

 

We can manually launch the viewer application at start up, have been doing that for years.

The, lets call it capture feature, just needs to replace a file every 2 sec on either the local or networked machine, network machine will process the image as needed, when needed,i just need to ensure the image being processed has been produced in the last 2 sec.

 

And once again, I would like to "fight through" as much as I can, as I learn better that way, just need a point in the right direction and possibly an example or 3 to ponder over.

 

The correct question I should be asking is "How to I gain control of an application with VI Server using TCP communication, on the same machine?"

0 Kudos
Message 11 of 18
(827 Views)

@RichardVaughn wrote:

After a bit of prying,

It turns out that the method they used originally to "capture" the image from the application was not guaranteed to work on this system. It was one of those things that might work but not guaranteed to work. This same feature is being used in another facility on 2 exactly the same machines, one works the other doesn't. Another process has to be developed as this option is not working, but as mentioned it was not something that was suppose to work, we just got lucky.....

 

The application itself works perfectly.

I can manually save the image and move/replace the JPG to the secondary machine, however I don't want to stand there 24 hours a day when production fires back up.

I am not trying to recreate the issue in LabVIEW, just trying to use the method that was recommended by the OEM of the application.

 

The information provided by the OEM is probably enough info for a seasoned labVIEWer, but my limited understanding is preventing me from gaining any ground.

 

From what I have gathered, I am not bypassing the viewer program and processing the data from the flexRIO card, just automating the controls of the application via VI Server.

 

Here goes my limited through process

Step 1.) Run at start up

Step 2.) Listen for tcp connection to be established

Step 3.) Once connection is made.

Step 4.) Every 2 sec, "click" the Save button in the application.

 

Rinse and repeat, never stop.

 

Once I get this working, I can expand on controlling the file name, data type, and location within labView and pass these settings to the application.

 

 

We can manually launch the viewer application at start up, have been doing that for years.

The, lets call it capture feature, just needs to replace a file every 2 sec on either the local or networked machine, network machine will process the image as needed, when needed,i just need to ensure the image being processed has been produced in the last 2 sec.

 

And once again, I would like to "fight through" as much as I can, as I learn better that way, just need a point in the right direction and possibly an example or 3 to ponder over.

 

The correct question I should be asking is "How to I gain control of an application with VI Server using TCP communication, on the same machine?"


Perfect!  I understand now.  Thank you for your patience.

 

It might be helpful if we could take a look at the batch file to determine what it was trying to do.  Is it okay to do that, or is this considered proprietary information (yours or theirs)?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 12 of 18
(819 Views)

Can you post the script that you had been using? It might give us a better idea of what was being done. Also, in a simple VI use the "Open Application Reference" with "localhost" if running LabVIEW on the same machine or the IP address of the machine if you are running on a different PC to open a reference to the VI. From there you can use the property and invoke nodes to poke around the application. You will need to get references to the Save button as well as the other controls (filename) you want to interact with. Your new VI would use that reference and "Click" the Save button every 2 seconds by setting its value to True. You may need to do it via value signaling.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 13 of 18
(817 Views)

Here is what the batchfile contained

 

loop

activate title "Camera Display" (this is the name of the window produced by the application)

Del text file on remote system

Wait 100

SaveScreenshot to win "remote file location here"

Wait 100

Replace text file it deleted

goto loop.

 

Deleted and replaced text file has nothing in it.

It is being used as a heartbeat to validate the two systems are connected.

Prior to processing the Image file it validates the text file is present, then validates the file is gone.

After validation, the test moves on to processing the image file.

 

This is what the batch file did.

 

But the screen grab doesn't work on this window.

Developer tried to find some access violation, and could not find any. When the screen grab happens the "display" window becomes hidden and you get a screen shot of whatever was directly behind the image.

Not even the dev knows what is wrong with it, only that it doesn't work here or at the other facility on one of their machines.

OEM says, use vi server method and that is all.

They do not support the batch file work around because it is not their recommended process for saving the image..

"Use the VI Server Method, using the settings provided in the user manual." is their reply.

 

Being that we can manually perform the task directly through the application, the OEM says its not their fault.

 

 

The dev appears to know nothing about labview, so that is why they hacked something up.

Their fix will require "extensive testing and development" at a nominal fee of course, still waiting for their fix quote.

 

 

 

0 Kudos
Message 14 of 18
(815 Views)

Please provide the actual contents of the batch file, not the description. Anyway, look at my previous post. Open LabVIEW and create a VI which uses the "Open Application Reference" to obtain a VI Server connection to the application. From there you can get the references of the controls. It may take a bit of effort since they could be in subpanels or on tabs. You will have to root around with the various property nodes to find what you need. Once you have that, create a VI that connects to the application and then periodically sets the value of the Save button to true. That should should achieve what you want.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 15 of 18
(799 Views)

Thank you for the steps to build this vi, I am going to go poke at it and see if I can make it angry.

 

Message 16 of 18
(796 Views)

Don't forget to check out the training resources on the main forum page.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 17 of 18
(785 Views)

In an executable, the ini file should have these items:

[MyExe]
server.app.propertiesEnabled=True
server.ole.enabled=True
server.tcp.paranoid=True
server.tcp.serviceName="My Computer\VI Server"
server.vi.callsEnabled=True
server.vi.propertiesEnabled=True
WebServer.TcpAccess="c+*"
WebServer.ViAccess="+*"
DebugServerEnabled=False
DebugServerWaitOnLaunch=False
colorHistoryItemA=00B9FF2A
server.tcp.enabled=True
server.tcp.port=3369

server.tcp.acl="290000000A000000010000001D00000003000000010000002A10000000030000000000010000000000"
server.vi.access="+MyVI.vi"

 

 

Then open a reference to the exe, the VI, the contols, like this:

Application Reference To An Exectuable.png

0 Kudos
Message 18 of 18
(773 Views)