04-12-2007 08:15 AM
04-14-2007 11:22 AM
04-14-2007 02:26 PM - edited 04-14-2007 02:26 PM
Actually there is such a document. It's the Windows SDK headers but it is not one single document but a few hundred header files. msdn.microsoft.com is also a good place to find that information although finding datatypes can be sometimes difficult, but if you know a function that uses such a datatype then you get there usually quite fast.
@duffman Says: wrote:
Hello SODLB,
Unfortunately there is no document that would describe all of the hundreds of data types used in the Win32 SDK and how these would map to LabVIEW types. In fact, most of these are not even standard C data types. However, most of them can be associated with a particular C type and thus the LabVIEW type can be inferred. The best resources for determining these data types are the SDK documentation and the windef.h for the type’s #define or typedef statement. You might also want to take a look at the Calling the Win32 SDK application note which further discusses the Win32 SDK as well as some discussion of data types. I hope this is useful for you!
Mike D.
National Instruments
Applications Engineer
Message Edited by rolfk on 04-14-2007 09:32 PM
03-17-2008 05:13 PM
Can anyone here tell me for sure that I am wasting my time? I have a system that acquires data and creates specific audio tones. I have a usb to midi converter and a midi sound device. I can create audio tones (notes on/off) over the usb to midi with labview just fine using a midioutshortmsg call library function to the winmm.dll. There is a bunch of setup commands that I would like to send to the midi tone generator using labview that I am currently doing manually. The problem is that these setup commands fall into a category of midi called system exclusive messages because they can be different based on the manufacturer and user programmable features. Built into the win api is a way to send midi system exclusive commands using the MidiOutLongMsg, MidiOutPrepareHeader and MidiHDR. I'm not a good C programmer so I am struggling to figure out how to do this.
Here is the definition for MidiOutLongMessage
http://msdn2.microsoft.com/en-us/library/ms711629(VS.85).aspx
I am hoping that the datatypes will match up in Labview.
MidiOutLongMsg & MidiOutPrepareHeader
HMIDIOUT hmo (signed 32 bit integer)
LPMIDIHDR lpMidiOutHdr (signed 32 bit integer)
UINT cbMidiOutHdr (unsigned 32 bit integer)
Before you send the MidiOutLongMsg you have to fill a buffer up with all the system exclusive commands that you want to send. I'm pretty lost at this point. I know the commands that I want to send because they are all listed in the manual for the synthesizer. How do you create a buffer area using Labview that can be pointed to in the win api?
http://msdn2.microsoft.com/en-us/library/ms711592(VS.85).aspx
The MIDIHDR structure defines the header used to identify a MIDI system-exclusive or stream buffer.
typedef struct midihdr_tag { LPSTR lpData; DWORD dwBufferLength; DWORD dwBytesRecorded; DWORD_PTR dwUser; DWORD dwFlags; struct midihdr_tag * lpNext; DWORD_PTR reserved; DWORD dwOffset; DWORD_PTR dwReserved[4]; } MIDIHDR, *LPMIDIHDR;