Skip to main content
Submitted by toney.stirewalt on Tue, 08/01/2017 - 11:58

I am writing a c++ dll to talk to a galil 4060 via ethernet. I am using gclib and gcaps with GCommands and GMessage, but I am having trouble receiving unsolicited messages. I have one thread sending GCommands from another application and returning values immediately. I have a second thread that continuously calls GMessage to watch for the unsolicited messages. I never receive anything from the GMessage calls.

Are these the correct calls with the correct parameters to GOpen? (code sample follows, but does not show up in the trimmed version)

GCon galilCtrlHandle = 0 ; /***** main thread for GCommand *************/
int gstatus = GOpen("192.168.1.20 -p1", &galilCtrlHandle);
... GCommand works well ...
GCommand("XQ #IAMHERE,1");

GCon galilUnSolHandle = 0 ; /****** second thread for GMessage *************/
int gstatus = GOpen("192.168.1.20 -p2 -s MG", &galilUnSolHandle);
... GMessage always times out ... documentation seems to say that I do not need the CFI;CW1 commands

dmc code for #IAMHERE (send an unsolicited message every 2 seconds):
#IAMHERE
#IAmHere
MG "~~DMC_OK"
WT 2000
JS #IAmHere
EN

Comments 1