06-13-2012 09:19 AM
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
06-13-2012 01:03 PM - edited 06-13-2012 01:04 PM
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.
06-15-2012 08:20 AM
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?
06-15-2012 11:19 AM
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.
06-19-2012 04:30 AM
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).