LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

From VB to Labview

Hi:

 

I am trying to create a LabView VI ( I am using LabView 2010 we are up-grading next week to 2015 but I need to finish the VI in Labview 2010 )  to control a Keyence SR-752 barcode reader. I have been able to connect to the reader send commands for lights ON/OFF and take pictures and live view. I do have a problem is getting the decode barcode information. Below is the VB.NET section I am having problem with. I any could give me a helpping guide

 

 

0 Kudos
Message 1 of 3
(3,034 Views)

I'm not 100% sure it can't be done in LabVIEW but I don't think that any code involving delegates can be implemented in LabVIEW.

 

I'd love to be proven wrong but it may require coding a wrapper DLL in C# if using delegates is 100% necessary.

0 Kudos
Message 2 of 3
(3,026 Views)

@Kyle97330 wrote:

I'm not 100% sure it can't be done in LabVIEW but I don't think that any code involving delegates can be implemented in LabVIEW.

 

I'd love to be proven wrong but it may require coding a wrapper DLL in C# if using delegates is 100% necessary.


You won't need a delegate to translate to effective code in LabVIEW. You need to register for the OnDataReceived event of the control and handle the EventArgs data

 

The delegate in the example code is used to get around the .NET philosophy that controls can only be accessed from the thread that they were created; the Dispatcher.Invoke call allows this to happen (ie. it executes the method referred to by the delegate in the UI thread). LabVIEW handles this for you automatically - you just need to write the data content to a String indicator (presumably) from the event handler.

0 Kudos
Message 3 of 3
(2,992 Views)