MIDI Read function in LabVIEW 8.2

Is there a MIDI read function in LabVIEW 8.2?

http://forums.ni.com/ni/board/message?board.id=170&message.id=280480#M280480
You could have aksed it in your previous post since it concerns the same functions.
André
Message Edited by andre.buurman@carya on 10-26-2007 09:12 AM
Regards,
André
Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

Similar Messages

  • Help with the MIDI read function

    Since my last post, I have gotten NI LabVIEW 8.5 and DSP module 2.5.  Using the MIDI read function I was able to get it to read from MIDI-Yoke and plot onto some graphs.
    My problem, however, is that I'm not sure how exactly the MIDI file is being read.  The DSP module update files say that the information is sent as an array of 5 notes.  This is clear to see that it is reading in these 5 values.  When I plot wire the MIDI read to a graph however and/or output through a DSP board, It seems as though I am only getting one of those values.
    Can anyone tell me if I am doing anything wrong or how to get all the values from the MIDI read plotted and outputed.
    Thanks

    Attached is a screenshot of my front panel.
    Yes it seems as the array is being read in through the MIDI read (all 5 values are showing up).  On the graphs, I suppose it would be all five values plotted at once.  This makes sense to me, and what I initially thought.  What made me skeptical of the function was that when I outputted the signal, I didn't hear the same sound as was being inputed.  As I previously mentioned, I could only hear a really high pitched sound, that was the rythm of the particular MIDI file.  It wasn't the original sound.  (I was testing the output.  I would like to add synths, filters, etc. and be able to output this so that the changes can be heard, not just seen on graphs)
    Thanks for the help,
    Joeyio
    Attachments:
    simple_MIDI Read.jpg ‏174 KB

  • Midi Read Control not seen in LabView 8.2-- speedy-33

    Hi All,
    The document LV DSP Module Release and Upgrade Notes on http://www.ni.com/pdf/manuals/371298c.pdf  says that it is possible to read MIDI files with LV and play them on Speedy 33. After installing 3rd party tools Midi Yoke and Midi OX, it is said that the LV should be able to read MIDI data. Specifically, the following is noted in the doc.
    "MIDI Read—Appears as a custom numeric control in a front panel window. This control works with the MIDI-OX software. The MIDI Read control reads MIDI data for any MIDI file the MIDI-OX
    software plays. The output of the MIDI Read control is an array of five notes that represent the musical content of a MIDI file that MIDI-OX generates."
    I have Labview 8.2, XP as the O/S, and Speedy-33 as my DSP Platform. I have installed everything correctly, everything seems to be working fine, however, this MIDI read control is not seen in the control menu. Why I am not able to see this control, where is it? Could this control be only specific to LabView 8.5 because the above document seems to be referring to LabView 8.5?
    Thank you very much for any input!
    Casiopea

    http://forums.ni.com/ni/board/message?board.id=170​&message.id=280450#M280450
    http://forums.ni.com/ni/board/message?board.id=170​&message.id=280443#M280443
    Either of these were a better place than a new thread.
    André
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • Req any examples of how to use a USB midi controller​/keyboards with Labview TIA

    Req any examples of how to use a USB midi controller/keyboards with Labview TIA

    Hi,
    To access the MIDI ports you will need to call the Windows SDK. To send MIDI commands is relatively easy, here is an example that shows you how to send data to a MIDI controller or keyboard.
    As far as input goes, this is the hard part. There are a series of functions that you need to call to open up the device, set some buffers and and possibly a callback to get notifications on the incoming data.
    Reading MIDI data will not be an easy task, your best bet will be to implement this in a DLL and call that DLL in LabVIEW, there should be some code available o the web.
    = "http://msdn.microsoft.com/library/default.asp?url​=/library/en-us/multimed/htm/_win32_multimedia_... is a link to the Windows multimedia functions that you could use for MIDI input.
    Let me know if you have any further questions.
    Regards,
    Juan Carlos
    N.I.

  • Can I put a READ function in a TRUE/FALSE case structure?

    Hi,
    I have a vi that operates as controller for a mechanical system of motors.  There are several sensors of various types, that provide input to the vi, including encoders, whose period is being measured.  The attached vi is the encoder period measuring part. It measures 15 periods and tells me the average of the 15 with each loop iteration.
    In my application, the encoder period measurement is not needed unless the vi knows that ALL THE OTHER sensors in the hardware configuration are measuring values within the desired range.  For example, Sensors A, B and C should all measure between 5-10.  If they are all showing values between 5-10, then, we want the encoder value to read and display.  If only one of the sensors, say A, is measuring 12, then, we don't want the period value to READ or be subsequently processed.  So, it is easy to set up the sensors A, B, C, to give a TRUE or FALSE based on whether they are within range or not, and if all 3 are TRUE, then, that value can easily be passed to the case structure that holds my READ function for the period.  Is this a good way to do this?  The goal is to eliminate unnecessary execution time that the period READ function would consume, as well as all subsequent calculations that are performed on the period value collected.  The period data is of no use if any one of the other sensors is not in the correct range.
    If any one of the other sensors is out of range, we want to skip the encoder READ step altogether.  So, it is easy to structure a BOOLEAN in my vi as shown in the attachment.  If I do it this way, will it throw an error, or just skip the READ until the BOOLEAN is true again?  Is there a better way to prevent the READ from happening if one of my other sensor values is not within the correct range?
    Thanks,
    Dave
    Solved!
    Go to Solution.
    Attachments:
    forum JUly 18.vi ‏26 KB

    Sure, you can put a Read inside a case structure. For your application, just check that your sensors are all within range (Comparisons palette), then AND the T/F's and use the result of that for your case structure. (If you are already doing the in-range check, I can't see it here because you have 5 subVIs that I cannot open here.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • Create a continuous data stream from C++, and read it in LabView

    Hello all.
    I'm working on a project which involves connecting to a motion tracker and reading position and orientation data from it in realtime. The code to get the data is in c++, so I decided that the best way to do this would be to create a c++ DLL file which contains all the necessary functions to first connect to the device and read the data from it, and use the Call Library Function node to feed this data into Labview. 
    I'm having trouble though, since ideally I would like a continuous stream of data from the c++ code into Labview, and I'm not sure how to achieve this. Putting the call library function node in a while loop seems like an obvious solution, but if I do it this way I would have to reconnect to the device every time I get the data, which is quite a bit too slow. 
    So my question is, if I created c++ function which created a data stream, could I read this into Labview without having to continually call a function? I'd prefer to only have to call a function once, and then read the data stream until a stop command is given.
    I'm using Labview 2010, version 10.0.
    Apologies if the question is poorly phrased, many thanks for your help.
    Dave
    Solved!
    Go to Solution.

    dr8086 wrote:
    This method sounds like an excellent suggestion, but I do have a few questions where I dont think I've understood fully.
    From what I understand the basic premise is to use one call library function node to access a DLL which creates an instance of the device object, and passes a pointer too it into labview. Then a seperate call library function node would pass this pointer to another DLL which could access the device object, update it and read the data. This part could be in a while loop and carry on reading the data until a stop command is given.
    That's it. I'm including some skeleton code as an example. I'm also including the code because I don't know how much you have experience with multi threading, so I'm showing how you'd have to use critical sections to guard the interactions between threads so that they don't lead to issues.
    // exported function to access the devices
    extern "C" __declspec(dllexport) int __stdcall init(uintptr_t *ptrOut)
    *ptrOut= (uintptr_t)new CDevice();
    return 0;
    extern "C" __declspec(dllexport) int __stdcall get_data(uintptr_t ptr, double vals[], int size)
    return ((CDevice*)ptr)->get_data(vals, size);
    extern "C" __declspec(dllexport) int __stdcall close(uintptr_t ptr, double last_vals[], int size)
    int r= ((CDevice*)ptr)->close();
    ((CDevice*)ptr)->get_data(last_vals, size);
    delete (CDevice*)ptr;
    return r;
    // h file
    // Represents a device
    class CDevice
    public:
    virtual ~CDevice();
    int init();
    int get_data(double vals[], int size);
    int close();
    // only called by new thread
    int ThreadProc();
    private:
    CRITICAL_SECTION rBufferSafe; // Needed for thread saftey
    vhtTrackerEmulator *tracker;
    HANDLE hThread;
    double buffer[500];
    int buffer_used;
    bool done; // this HAS to be protected by critical section since 2 threads access it. Use a get/set method with critical sections inside
    //cpp file
    DWORD WINAPI DeviceProc(LPVOID lpParam)
    ((CDevice*)lpParam)->ThreadProc(); // Call the function to do the work
    return 0;
    CDevice::~CDevice()
    DeleteCriticalSection(&rBufferSafe);
    int CDevice::init()
    tracker = new vhtTrackerEmulator();
    InitializeCriticalSection(&rBufferSafe);
    buffer_used= 0;
    done= false;
    hThread = CreateThread(NULL, 0, DeviceProc, this, 0, NULL); // this thread will now be saving data to an internal buffer
    return 0;
    int CDevice::get_data(double vals[], int size)
    EnterCriticalSection(&rBufferSafe);
    if (vals) // provides a way to get the current used buffer size
    memcpy(vals, buffer, min(size, buffer_used));
    int len= min(size, buffer_used);
    buffer_used= 0; // Whatever wasn't read is erased
    } else // just return the buffer size
    int len= buffer_used;
    LeaveCriticalSection(&rBufferSafe);
    return len;
    int CDevice::close()
    done= true;
    WaitForSingleObject(hThread, INFINITE); // handle timeouts etc.
    delete tracker;
    tracker= NULL;
    return 0;
    int CDevice::ThreadProc()
    while (!bdone)
    tracker->update();
    EnterCriticalSection(&rBufferSafe);
    if (buffer_used<500)
    buffer[buffer_used++]= tracker->getRawData(0);
    LeaveCriticalSection(&rBufferSafe);
    Sleep(100);
    return 0;
    dr8086 wrote:
    My main concern is that the object may go out of memory or be deallocated, since it wouldnt be held in any namespace or anything.
    Since you create the object with new, the object won't expire until either the dll is unloaded or the process (LabVIEW) closes. So the object will stay valid between dll calls provided LabVIEW didn't unload the dll (which it does if the VIs are closed). When that happens, I'm not exactly sure what happens to live objects (i.e. if you forgot to call close), I imagine the system reclaims the memory but the device might still be open.
    What I do to make sure that everything gets closed when the dll unloads before I could call close and delete the object is to everytime I create a new object in the dll I add it to a list, when the dll unloads, if the object is still on the list I delete it.
    dr8086 wrote:
    I also have a more general programming question about the purpose of the buffer. Would the buffer basically be a big table of position values, which are stored until they can be read into the rest of the VI? 
    Yes, see the example code.
    However, depending on the frequency with which you need to collect data from the device you might not need this buffer at all. I.e. if you collect a sample about every 100ms then you could remove all threading and buffer related functions and instead read the data from the read function itself like this:
    double CDevice::get_data()
    tracker->update();
    return tracker->getRawData(0);
     Because you'd only need a buffer and a seperate thread if you collect data at a high frequency and you cannot lose any data.
    Matt

  • VISA Read function Read buffer problem in serial communication

    Hi,  I use VISA write and read function in serial communication app, the device continuously sends 0x00 if it is not receive a request from Labview program running on PC.
    And the request sent by labview is programmable. I met a weird problem, each time the request changes, the VISA read buffer output port still shows the last request firstly, from second time, shows the right request.
    It works like: Req code: ... 50, 51,51,51,50....;  VISA Read buffer: ...50, 50, 51, 51, 51, 51, 50....
    Please refer to the program.
    Attachments:
    readOne_test.vi ‏21 KB

    How are you running this?  You don't have a while loop around it.  Is it part of a larger VI?  Please don't tell me you are using the run continuously button.
    You don't have any wait statement between you VISA Write and your bytes at port.  So it is very likely the receive buffer is still empty since you didn't give your VI time to wait for the device to turn around and give a reply.  If you read 0 bytes, your VISA read string will be empty.  How does your decoder subVI (which you didn't include) handle an empty string?

  • Functions in labview

    Hy,
    I've got a question concerning functions in Labview.
    Is it possible to see the *source* of a function ?
    I'm working with the "Butterworth filter" and I need to know how it
    works *in the inside* :]
    Thank,
    Maura

    On Sat, 10 Jul 1999 23:19:29 GMT, Greg McKaskle
    wrote:
    >> I've got a question concerning functions in Labview.
    >> Is it possible to see the *source* of a function ?
    >> I'm working with the "Butterworth filter" and I need to know how it
    >> works *in the inside* :]
    >>
    >
    >The majority of the simple DSP functions are, to my understanding,
    >taken from the Numerical Recipes in C textbook. If you can get
    >your hands on a copy of that book, it will probably be the same,
    >or at least a very similar implementation.
    >
    >Greg McKaskle
    Thanks a lor for the info.
    So there is no way to get the algorithm directly from labview?

  • Can i call winmain function in labview

    hello everyone,
    Well i have written a C++ code that uses the  winmain function (windows function). i want to convert this code into dll and call that dll into labview.
    Is it possible to  call winmain function as one of the functions in labview. Please let me know as soon as possible.
    Thank you.
    Royal  tiger......

    You didn't say what development environment you're using, so I'm assuming Visual Studio. It sounds like you created a Win32 app (as opposed to an MFC app). This has a "WinMain" function. The prototype for WinMain is geared towards it being called by the OS when you run the executable. You could just add the __declspec(export) directive in front of the return type, but you also need to change some build functions in Visual Studio to get a DLL. You probably also don't need all the arguments that WinMain uses. You're probably better off by starting with a new DLL project in order to get the framework for a DLL, and then copy and past the function code. That's what I would do.
    I would also strongly suggest that you crack open the "Using External Code in LabVIEW" manual that gets installed when you installed LabVIEW. It's in the "manuals" directory, filename of "lvexcode.pdf".

  • Send data from GPIB Read Function to XY Graph

    hello
    I'm really new to LabVIEW so this is probably an easy one, but I'm having a serious issue trying to figure this one out. how do I send data from GPIB Read Function to a graph, let's say XY Graph. my data consists of a string of numbers, separated by commas, alternating between X and Y values. for instance:
    0, 0, 0.1, 0.2, 0.2, 0.4, 0.3, 0.9, 0.4, 1.6, 0.5, 2.5, 0.6, 3.6, 0.7, 4.9
    which would graph a parabola. I tried to connect the output (data) of BPIB Read Function to XY Graph, but I get an error. do I have to do something else before I send that data to the XY Graph? thanks for any suggestions.
    r. 
    Solved!
    Go to Solution.

    first of all, thanks a bunch for replying
    I added "spreadsheet string to array function" and it looked OK (I didn't connect anything to 'array type' because I couldn't figure out what those blocks were - I'm really new to LabVIEW"
    I couldn't find "decimate array" so I added "decimate 1D array," which is what my labVIEW listed (I have 8.6). I fed that directly into "express XY Graph," which lets me feed separate X and Y values (or so I assume). but, even though the input to "decimate 1D array" and output of "spreadsheet string to array function" say 'array' - the program is not happy. when I move my mouse over the 'x', the following is the message that I get:
    "you have connected two arrays of different dimensions.
    The dimension of  is 2. 
    The dimension of  is 1." 
    I'm not quite sure what that means. any suggestions what I can do with it?
    Attachments:
    Picture 1.png ‏11 KB

  • Problems of integrating Matlab functions in Labview

    Hi,
    Does anyone know how to completely integrate Matlab functions into Labview program without a copy of Matlab in the system when I run the entire program?
    Initially I used 'Mathscrip' node but I heard that it doesn't support Matlab toolbox.  Thus, I tried out the other option 'Matlab script' node. This node works well in implementing Matlab functions but it indeed requires Matlab installed in the system. 
    So in other words, how could I realize the full integration(as what Matlab script node achieves.)  without Matlab installed in the system?   
    Cheers,
    Nicholas 

    hi smercurio,
    So you mean that the Matlab script is no longer necessary in my case right?
    Could I just ask my colleague to compile his codes to matlab dll and I use the Call Library Function Node  instead of Matlab script to call it?
    About MCR, is it the correct source at the following link  http://www.mathworks.com/matlabcentral/fileexchange/5268 ?
    Sorry for those basic queries in Matlab as I have very little experience in it. lol... thanks a lot.
    Cheers,
    Nicholas 

  • How to get Midi echo function?

    I can't get midi echo function: triggering contemporary 3 (or more) channels of a multi instruments. How can it be done?

    Hi mn,
    You still use contemporary (which means: of the same era/time in history) where you mean simultaneously (=at the same time). Try another translation site...
    If you want to trigger three channels I would probably make three tracks, each with the same region on it, all assigned to their own unique MIDI channel (1, 2 and 3 in this case). Then apply sufficient delay via the Inspector to the two 'echoing' tracks.
    Of course this is only editing after recording MIDI. If you want it 'live' (as you play), you'll need to go into the environment and create a note duplicating and delaying setup.
    But why use MIDI echo? You could simply use the *Delay Designer* to get the same (or probably better ) effect?

  • Error 42 : Datasocket Read Function

    Hello,
    I have a problem about DataSocket Read Function . I want to read some data from OPC server. I read data and its value 100  as seen in picture dOPCexplorer . But when I give a start Labview .exe as seen Santral Veri Kayıt.vi, I get error 42 about DataSocket Read. Can anyone help me when solving this problem?
    Attachments:
    LABWIEW.PNG ‏89 KB
    OPC SERVER.PNG ‏109 KB
    OPC EXPLORER.PNG ‏132 KB

    What is the OTHER error on that front panel about? Could the two errors be related?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Read sms in labview

    i want to receive sms from user and read it in labview, after that i need to check the sms for a correct command, the command like sending x0 to excecute a subVI.
    i found the attached example online and its programmed to receive code from x0 to x10 from the user. the problem is that i dont understand how does the labview read the message. and how the labview check inside the sms for the correct code using patterns check block. also in the program it doesn't consider that the received sms will contain the sender mobile number and the time !! so how is this doen! 
    i need your help please.
    Thank you  
    Attachments:
    read_sms.jpg ‏109 KB

    The program you referenced simply uses a VISA read to read out a raw string.  It then parses the string for the correct information.
    I would recommend you do the same.  Parse the raw string for the information and command you are looking for.  The Scan From String function is pretty good, though the format string can be a little tricky to figure out.  Format Specifier Syntax
    Chris
    Certified LabVIEW Architect
    Certified TestStand Architect

  • At what time you have looked at a message according to the "read" function.

    I was wondering, if you look at a message that was sent to you through iMessage again and you have the "read" function enabled, will the time that you viewed the message change. The reason to why I am wondering this is because I received a message at a certain time, while the "read" function said that the message was viewed way later, after I had received my response.
    Thank you in advance!

    It should be the same. Did you look at the message in the app the first time, or through the notification? I have the read function on, and it will not show "read" until I actually go into the app.

Maybe you are looking for