From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Advantech TPC 1271 Buzzer function

Hi

I want to enable an internal buzzer function on Advantech' 1271 touch panel computer. The program is very simple, I want the buzzer active for 3 sec before being disabled. I am programming on a development computer and transfering exe files for the TPC. I don't know what I'm doing wrong, but the created exe crashes on initiation.
There are some examples which control the buzzer with the drivers I downloaded from Advantech, but in different programming languages.  I have confirmed that it is possible to use the buzzer with these applications but want to implement the functionality in Labview

 

I am using Advantech UNODIO driver user manual and AdvUNODIO.dll which I downloaded from Advantech. I have tried to change parameters to fit with example in the attachment, but without any sucess.
Hope somebody can help me with this problem.

Gremio


Capture.PNG

Capture1.PNG Capture4.PNGCapture5.PNG

0 Kudos
Message 1 of 2
(2,632 Views)

The DeviceOpen function takes a pointer to an I32, which it looks like you are passing in properly, and which then makes this I32 become the handle to the device.  However, subsequent functions need to use the handle.

 

In the code in the image you attached, you are doing this properly, which is why it works.

 

In the LabVIEW code in your post, you are passing in a new constant to each BuzzerEnable (and other following functions), with a value of 0 each time.  You need to have them all using the same handle.

 

If you wire the handle output (the bottom right I32 terminal on your DeviceOpen library call) to your next function and then chain it like that it will work.  The corresponding right-side terminals for a pointer argument will be the value at the location of the pointer argument after the library function returns (in your case, after your library populated the location with the handle value).

 

 

Also note that the error out terminal for a call library function is LabVIEW's errors in calling the function - the function's actual return value, which for you indicates success or failure and which you have handled in your attached textual code, is the top-right output terminal.



0 Kudos
Message 2 of 2
(2,615 Views)