Running exec file with parameters

Support forum for MegunoLink
Post Reply
mr.yuval.sh
Posts: 2
Joined: Mon Nov 02, 2020 11:00 am

Wed Feb 03, 2021 9:54 am

Hi,

I used the megunolink as a GUI for checking hardware units (The megunolink connects via RS-232 to my custom hardware and control it).
This custum harware is also connected to another hardware which is UUT (Unit under test). my custom hardware sends test commands to the UUT and on the other side - sends the results to the PC (Megunolink)

**************** ************* ************
* pc * <--> * custom * <--> * UUT *
* meguno link * rs232 * hardware * * *
**************** ************* ************

This works very well !!!

However, Now I want to to add a feature - printing "labels" for my units when the UUT test succeeded !

I thought about writing a C# ".exe" program which will get some parameters and when the UUT test finished ok - the megunolink will call this ".exe" with some arguments.
F.E: "print_label.exe -c1234 -v10....."

I already saw that there is "open local document" which has ."filename" that on pressing on the button can be executed.
i thought of telling my "custom hardware" to send a command to the megunolink to change this "filename" to the name i need: F.E: {UI|SET|PRINT_LABEL.Filename=print_label.exe -c1234 -v10}
But i saw that the megunolink don't find the "print_label.exe" file (maybe it thinks that "print_label.exe -c1234 -v10" is the file name)
also I just don't know how can i tell the "PRINT_LABEL" to activate (run this command without a human pressing)

So,
Is there a way to run external ".exe" program with arguments from the megunolink ? and Is there a way this can be done automatically by a command from my "custom hardware" and not by physicals presseing ?

B.r
Yuval.
Paul
Posts: 26
Joined: Wed Jun 10, 2015 10:35 pm

Thu Feb 04, 2021 8:45 am

Hi Yuval,

That's a pretty interesting use-case. Unfortunately it isn't completely supported right now. We are working on a new release so I'll try to get a better solution into that. In the mean-time, a couple of options:

1. Write the label info to a file using the message logger (https://www.megunolink.com/documentatio ... reference/), then have your custom label printing program monitor that file for changes (https://docs.microsoft.com/en-us/dotnet ... work-4.7.2). You can open the file read-only from your custom program.
2. Send the label data to a Property table visualizer https://www.megunolink.com/documentatio ... rty-table/and use reporting (https://www.megunolink.com/documentatio ... reporting/) to save the table content with a command from your supervisor Arduino (https://www.megunolink.com/documentatio ... reference/). Then have a button on the interface run a batch file that reads the report file, does the print then deletes the report file.
3. Pre-print the labels and send the label info to the supervisor program to pass on to the test device from a field on an interface panel. This is an approach we've used in the past to avoid multiple units ending up with the same id. MegunoLink also has tools to write ids to the device using an ISP (https://www.megunolink.com/documentatio ... nique-ids/).

Please let us know how you get on,
have a great day
Paul.
Post Reply