LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement the DLL for the I2C USB Converter from Coptonix

I need to implement the DLL for the I2CUSB Converter from Coptonix into a LV-Program.

 

I'm not sure how to use the BroadcastSystemMessage (part of user32.dll).

 

Attached you will find the manual of the converter.

 

And you'll see the VI that I have created.

 

Many thanks in advance!


Silvio

Download All
0 Kudos
Message 1 of 5
(3,225 Views)

That's an odd way for the DLL to work. You wouldn't actually be using BroadcastSystemMessage, as the DLL uses it to post a message to the host application (i.e., LabVIEW, or your built app if you create an executable). At least, that's my understanding from reading that section of the documentation. If that's the case, you should be able to use the LabVIEW Windows Message Queue Library for this. 

0 Kudos
Message 2 of 5
(3,216 Views)

Hello smercurio_fc

 

Thank you very much for your posting. I'm able now to deal with the BroadcastSystemMessage... One problem still occures: I can start the VI once and it returns 9 messages (for every event that the DLL sees), but if I start the VI again

it adds 6 additional messages. I tried to flush the MessageQueue but that didn't help? What can I do?

0 Kudos
Message 3 of 5
(3,194 Views)

I have no idea why you are getting 9 messages the first time, and only 6 the next. You would need to read the documentation on the library and/or contact the makers of that library.

0 Kudos
Message 4 of 5
(3,186 Views)

I found the reason why I got first 9 messages then 15, the third time 21 and so on. I used the Initiation for the I2C USB each time I started the VI.

First the DLL gives 9 messages because three messages tell that the device is avalaible and has changed. The second call just gives 6 messages back.

So the solution is to do the initiation just once in the very beginning. and I have always 6 messages (after the first call of the vi).

0 Kudos
Message 5 of 5
(3,174 Views)