LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading string from Galil onMessage Reg Event Callback

Hi,

I need to get the output string of an onMessage callback from Galil and I have been following the guide below:

http://www.galilmc.com/news/software/using-labview-galiltools-communication-library

So far, I have managed to get the messages working after i substituted the program to be uploaded via Galil with my own .dmc program and the MG commands display the messages perfectly on the String indicator. What I actually need is to get the String that is to be displayed and pass it as a string input somewhere else instead. 

I have tried using a property node, global variables and a type cast from the thread below but nothing seems to be working so far.

https://lavag.org/topic/4559-how-to-get-reference-to-text-of-stringconstant/

0 Kudos
Message 1 of 7
(3,607 Views)

Hi cannotdo,

 

So far, I have managed to get the messages working

On the Galil website you linked to is explained, how to setup a callback VI and how to transfer the received string to a string control in the main VI. (See the paragraph "Handling Events with Labview and the GalilTools Communication Library"…)

 

What exactly is a problem to you?

What have you tried so far? (Mind to attach your VIs?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(3,581 Views)

My problem arises as I am trying to call out the unsolicited message from galiltools as a string (MG ":ILD:SET 3.0E-3", where the unsolicited message ":ILD:SET 3.0E-3" (a command for a seperate device) is sent as a data string input via GBIP. Currently I've tried connecting the string indicator to the GBIP write from outside of the case structure, but it doesn't seem to work. 

 

 

The following attached is the VI i am working on,

And of the GBIP VI copied over from into my working VI, which works fine on its own. 

 

 

 

0 Kudos
Message 3 of 7
(3,571 Views)

Hi cannotdo,

 

those GPIBRead/Write expect an address string…

(Do you really need to use those old GPIB functions instead of VISA? Are you working with an NI GPIB interface?)

 

I've tried connecting the string indicator to the GBIP write from outside of the case structure, but it doesn't seem to work.  

Is the parallel (and uncorrdinated) execution of both kind of communications intended?

Your GPIBWrite needs to be executed AFTER you received that string. Easiest would be to wait for a string value change event: in your callback routine you should write the string data to your "message" string using a "value (signalling)" property.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(3,568 Views)

@GerdW wrote:

Hi cannotdo,

 

those GPIBRead/Write expect an address string…

(Do you really need to use those old GPIB functions instead of VISA? Are you working with an NI GPIB interface?)

 

I've tried connecting the string indicator to the GBIP write from outside of the case structure, but it doesn't seem to work.  

Is the parallel (and uncorrdinated) execution of both kind of communications intended?

Your GPIBWrite needs to be executed AFTER you received that string. Easiest would be to wait for a string value change event: in your callback routine you should write the string data to your "message" string using a "value (signalling)" property.


Yes, as the device we're hooked up to are pretty old (ITC510), we're bound to using a NI GBIP interface.

And because we're using the DMC file as a master, the devices (Linear Stage Galil and ITC510) are commanded asynchronously. 

 

DMC file text looks something like this. With a brief explanation of what i hope to achieve.

MG ":ILD:SET 3.00E-3"  (Laser current setting for ITC510)

MG ":LASER ON"            (Turns on the Laser for ITC510)

PRX=20                            (Linear Stage codes, PR = moves to a relative position respective to axis)

SPX=10                            (SP controls speed of movement)

BGX                                  (Begin x-axis movement)

AMX                                  (Waits for x-axis movement to complete: controls the timing of events)

 

PRY=20

SPY=10

BGY

AMY

 

MG ":LASER OFF"          (The command for ITC to turn laser off)

 

EN

 

Thanks.

0 Kudos
Message 5 of 7
(3,564 Views)
UPDATE: I've figured out that the problem arises between calling back the message and triggering the case structure. Could someone help elaborate how to use a message to numeral conversion? as well as how the function of the case structure works with string & numerals (instead of using true false statements)
0 Kudos
Message 6 of 7
(3,530 Views)

Hi cannotdo,

 

Could someone help elaborate how to use a message to numeral conversion?

I suggest to use ScanFromString…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(3,526 Views)