DeviceNet .dll firmware integration into Labview

Hello all,
i have been charged with integrating DeviceNet on our new calibration system. Unfortunately, the company acquired a DeviceNet interface module from a vendor that does not include Labview interfacing VIs. I am therefore experiencing quite a lot of trouble integrating the firmware .dll. The vendor told me that it will take a while before they can help me.
I have succeeded at running some of simplest commands from the header file (ie open and close Api). However, more complicated commands, such as searching for nodes on the network, and explicit messaging are not working. This seem to be mainly caused by the way i input structures into the call library function node.
Can anybody tell me how to structure my inputs for these functions?
included are the header, the .dll and my own (clumsy) attempt at making the vi to call the functions.
thank you for your help
Message Edited by Nadsokor on 03-19-2007 08:16 AM
Attachments:
DeviceNet.zip ‏183 KB

Yes, you're right. Those inputs are not exactly what is expected.  However, where i encounter the most seriuos problems (up to and including Labview crashing) is when i have inputs consisting of structures defined in the header  file. One example is the GetNodeList method, which expects a pointer to a structure called TNodeList, defined as:
typedef struct
BYTE byCount;
TNodeDesc NodeDesc[64];
} TNodeList;
where NodeDesc[64] is an array with 64 entries where each entry consist of the following structure:
typedef struct
BYTE byMacId;
WORD wVendorId;
DWORD dwSerial;
} TNodeDesc;
I am unsure how such structures are defined in LabView for the "call library function" node.
regards,
Marc Fornes-Mora 

Similar Messages

  • How can I get an unsigned char string with nulls from a dll into LabVIEW 6i?

    The following ethernet packet data is contained in an unsigned char * string returned from my dll (it's formatted on printing):
    Received A 230 Packet On Adapter 0x008F0070
    Ethernet Dest: 01.E0.BB.00.00.15 Src: 00.E0.BB.00.DD.CC Type: 0x8868
    000000: 01 E0 BB 00 00 15 00 E0 : BB 00 DD CC 88 68 48 41 .............hHA
    000010: 00 E0 BB 00 DD CC 80 B3 : 00 00 FF FF 00 02 00 01 ................
    000020: 01 00 F0 18 FF 7F 7F FF : FF 7F 7F FF FF 7F 7F FF ................etc., etc.
    However, when I read this string into LabVIEW 6i, I only get the following:
    01E0 BB
    Which is the data before the first NULL or 00 information. I found a "Remove Unprintable Chars.vi" but it
    just sees more data before the above string, nothing after, as seen here: 5C30 31E0 BB.
    Anybody have any suggestions for how to get the rest of the string? Is there something I can do to further reformat my dll? The dll I'm using is already a wrapper around another dll so I have some flexibility, but the bottom line is, the data I want is in the format of an unsigned char *.

    Excellent advice, this mostly works so I have some further questions:
    I am just reading network traffic off my ethernet card right now, but here is what I get using my C program to test:
    000000: 01 E0 BB 00 00 15 00 E0 : BB 00 DD CC 88 68 48 41 .............hHA
    000010: 00 E0 BB 00 DD CC 80 B3 : 00 00 FF FF 00 02 00 01 ................
    000020: 01 00 38 3C FF 7F 7F 7F : 7F 7F 7F FF FF 7F 7F FF ..8<............
    000030: FF 7F 7F FF FF 7F 7F FF : 7F 7F 7F FF FF FF FF FE ................
    000040: FE FF FF FF FF 7F 7F 7F : 7F 7E 7E 7F 7F 7E 7E FF .........~~..~~.
    000050: 7F 7F 7F 7F FF 7F 7F 7F : 7F 7F 7F FF FF 7F 7E 7F ..............~.
    000060: 7F 7F 7E 7F 7F 7E 7F FF : FF 7F FF FF FE FF FF FE ..~..~..........
    000070: FF FF FF FF FF 7F 7F FF : FF 7F 7F FF FF FF FF FF ................
    000080: FF 7F 7F FF FF 7F 7F FF : FF 7F 7F FF FF 7F 7F FF ................
    000090: FF 7F 7F 7F FF 7F 7F 7F : 7F 7F 7F FF FF 7F 7F FF ................
    0000A0: FF 7F 7F 7F 7F 7E 7E 7F : 7F 7F FF FF FF FF FF FF .....~~.........
    0000B0: FF FF 7F FF FF 7F 7F FF : 7F 7F 7F FF FF 7E 7F FF .............~..
    0000C0: FF FF 7F FF FF 7F 7F FF : 7F 7F 7F FF FF 7F 7F FF ................
    0000D0: FF 7F 7F FF FF 7F 7F 7F : 7F 7F 7F FF FF FF FF FE ................
    0000E0: FE FF FF FF 00 01 : ................
    And here is what I get using LabVIEW to call the dll:
    0015 00E0 BB00 DDCC 8868 4841 00E0 BB00 DDCC 80B3 0000 FFFF 0002 0001 0100 9600 7F7F 7F7E 7F7F 7F7F 7F7F 7F7F 7F7F 7F00 B405 4300 3300 0000 0000 0000 01E0 BB00 0015 00E0 BB00 DDCC 8868 4841 00E0 BB00 DDCC 80B3 0000 FFFF 0002 0001 0100 9600 7F7F 7F7E 7F7F 7F7F 7F7F 7F7F 7F7F 7F00 F405 1B04 0C04 0000 0000 0000 8000 0000 0000 0000 0800 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    The first thing I notice is that the first 4 bytes are chopped off, and after about 50 bytes, the data is corrupted until the sequence starts to repeat, but this time it starts with the missing 4 bytes and still corrupts after about 55 bytes.
    I am expecting the data in LabVIEW to look very similar to the C data because the network packets I am grabbing are pretty consistant, only a couple bytes will vary between them, not the number I am seeing in LabVIEW.
    Another side effect I'm seeing is that I can only run my labVIEW code once, if I try running it again it crashes with failures such as:
    memory could not be "read"
    For reference, I am opening and closing the network adapter inside the read function of my dll, but the pointer seems like it should be intact...
    Attachments:
    zListAdapters.vi ‏30 KB
    listAdapters.dll ‏201 KB
    Reading.dll ‏213 KB

  • Integration of C++ program into Labview

    I have written a C++ program that generates low level code to control a machine. I would like to integrate this program into Labview. I would like to know what would be the best approach to do:
    - use CIN (code interface node). Can I take a few parameters as inputs and pass a string of characters to labview? Originally the C++ program generates a text file with the comands to control the device, I guess this can be substituted by a string control/indicator that will control the GPIB device.
    - use ActiveX
    - DLLs??
    Thanks in advance for your help.

    Madrid,
    I would recommend that you stir away from CINs. If you can compile your C++ code into a DLL, then you can easily call it from LabVIEW. CINs have the disadvantage that if you change your code in anyway, you have to update the CIN node in the diagram of the VI. However if you recompile your DLL, you don't have to inform LabVIEW that you have a newer version of your DLL. If the newer DLL is in the same path that LabVIEW is searching, then it'll link to it automatically.
    ActiveX is also a good choice. It might take more development time than creating a DLL though.
    My two cents,
    Azucena

  • Integrating PuTTY into Labview

    Hi, the LabView serial port session VIs do not communicate well with my stepper motors (they do not respond to 50% of the stepper motor commands - Excitron stepper motors)   I want to create a VI that integrates the PuTTY serial port session manager into LabView so I can use PuTTY within LabView to control my motors.  Can someone help please?   I have found some mentioning of PIPES to do this but when I try to add it to my block diagram it says its unavailable - that source was from 2006 maybe there is another way now?  I am running LabView 2010 for Windows Vista and I am not allowed to download anything over the internet from here - just FYI.  Thanks Folks  EE
    Solved!
    Go to Solution.

    For some reason LabView doesnt recognize several commands for my stepper motors:
    w (wake up)
    i (display current settings)
    P (display motion profile settings)
    Q (run proiles x-y)
    It obeys the others but I really need w, P and Q to work
    PuTTY runs everything
    I am using the basic serial port control VI (given in the examples) for the LabView control
    I am using VISA
    I was hoping integrating PuTTY would be easy and I could have full control in LabView
    Perhaps I should be doing something different in LabView?  I have only been programming for 3 months - it was new to me until then

  • Tutorial on integrating C/C++ code into LabVIEW (6.0 through 7.0)?

    Where can I get a tutorial that will show me how to integrate C or C++ code into LabVIEW?

    I would also check the Using External Code in LabVIEW manual, found here
    Bilal Durrani
    NI
    Bilal Durrani
    NI

  • Integrating matlab into labview

    Is it possible to integrate (import) a matlab file which uses special toolbox ( like hmm toolkit and neural network) into LabVIEW??

    When you say "one motor is connected to one matab file" - do you mean one .M file, or a MAT file ?  In other words, is it a program or data?  
    The easiest way that I"ve come across to transfer data between different environments, is to write to an intermediate file.   Be sure to  write to a raw binary or text (dont use the Matlab 'save' command, that will save in MAT format, which I'm pretty sure is unreadable by LabVIEW).   There is the problem of signalling the LabVIEW program when data is available, you could handle this by having the Matlab program could write to another file to indicate that data is availalbe, and the LabVIEW program could continuously poll this file to see if a value has been written.   Then the LabVIEW program would read in the data file, and reset the signalling file.

  • Converting HP-BASIC code into Labview or Labwindows

    I need some insight on as to whether I can use all my HP-Basic code in labview or labwindows and how? Can I create dlls and call them into labview or use the code itselg in LabWindows?
    Any information will be appreciated.

    A very long time ago, there was a BASIC version of LabWindows.  You could not convert a Rocky Mountain BASIC program directly, but it was a fairly simple fit.  You could then translate that into C code automatically through LabWindows.  That was one of its selling points; you didn't have to lose all of that old BASIC code.  About 10 years ago, they decided to go with only a C version of LabWindows and renamed it LabWindows/CVI.  This change was made because most people who were converting from BASIC to C already had and supporting two languages and a translator was very expensive (cost, memory, processing power, complexity, - expensive in every way). 
    If someone has an old version, you might have an upgrade path with your old code (no, I don't have any that old).  Otherwise, you could build DLLs and call them with either LabVIEW or LabWindows/CVI.  You could also recreate the code with the newer language.
    Hope that this helps,
    Bob Young
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]

  • Unattended Windows 8.1 Pro installation and Firmware integrated license key

    I have a brand new Lenovo Thinkpad that comes with a Windows 8 Pro license. According to what I read, the product key for Windows 8 for this machine is integrated into its firmware so I should be able to install a Windows 8 or 8.1 on it without need of a
    product key.
    The machine came preloaded with Windows 7 and a recovery set of DVDs for Windows 8. I want to do a fresh installation of Windows 8.1 directly. This is a pilot device for our new generation of PCs. Therefore I want to use an unattended installation that is
    automated with a XML response file.
    The problem is now with the product key. When I do not specify a product key in the response file, then the installation fails. When I specify some other key in the response file (such as one from our MSDN subscription) then the installation succeeds and
    Windows 8.1 automatically activates itself - but apparently using that MSDN key and not the one from the machine's firmware.
    How can that problem be solved?

    Thanks for the answer, but it solves only half of my problem.
    I can get through the installation with the default key. But then I cannot activate the system. It tells me that the key is not valid (well, true, the default key). But how do I get it to recognize the key stored in the computer's firmware?
    The Thinkpad has a "Windows 8" license sticker with just the Windows logo but no product key on it. This means, the product key is stored in its firmware memory.

  • I wish to know whether a program in VB can be downloaded into labview to make it into a VI

    I am interested in controlling a stepper motor using labview. I have the program developed in VB and the code is working perfectly. I wish to know whether it is possible to convert the VB file into a VI file with all the control palettes and loops. If yes, please give me the method of doing it.

    I'm not aware of any method for directly "translating" Visual Basic code into LabVIEW. However you can make use of the ActiveX and DLL access capabilities of LabVIEW to control a VB application.
    Also, I would suggest that you post your question in the LabVIEW section of Developer Exchange and not in the Motion section, in that way your question will be seen by LabVIEW users and not only Motion Control users. There will be lots and lots of more users in LabVIEW than in Motion Control that may give suggestions.
    The Development Library section in the Developer Zone will provide you with code and application notes for controlling external applications or code with LabVIEW.
    Good luck!
    Nestor.
    Nestor
    National Instruments

  • ActiveMovie Control,Translating ActiveX calls from Visual Basic into Labview

    Hello,
    I want to use DirectX to display a movie. In the attached file is a Visual Basic example
    which I tried to translate into Labview.
    To play the movie IMediaControl from ActiveMovie control type library Version 1.0 C:\WINDOWS\system32\Quartz.dll) is used.
    To display the current Position I tried to wire the IMediaPostion. But I have no idea how to implement this in the Block Diagram.
    After opening it the following message is shown.
    Error 3005 occurred at Automation Open: Object specified is not creatable in Play Movie Current Possition.vi
    Attachments:
    Play_Movie_Current_Possition.vi ‏48 KB

    Hello Joe,
    the Windows Media Player has a lot of overhead. I also found it difficult to deal with the different Versions.
    I want to display data in a graph and show the connected video frame in a separate window.
    I used the QuartzTypeLib because it is on every Windows Computer and is easy to code in VB.
    With one call I can start the video in Labview., but I find no way to wire the current position. I do not really understand how ActiveX is implemented in Labview. I attached a LV 7.0 vi. I hope you can open it.
    Tiemo
    Attachments:
    Play_Movie_Current_Position.vi ‏63 KB

  • DLL CALLBACK EVENT IN LABVIEW

    I am developing application using Labview 7.
    LabVIEW application is invoking VC++ dll.
    Is it possible in LabVIEW to get callback event from VC++ dll into LabVIEW application with some data like string ?

    I'm not sure that I completely understand your question, but it sounds like you are trying to take events from a DLL and pass them into LabVIEW. I've attached an example that does just this. Here is a brief description:
    This example demonstrates how to post a message to the LabVIEW event structure from a DLL and how to pass it data as well (using the PostLVUserEvent() function). The VI calls the dll, which in turn passes 3 messages to the event structure. The data ( in this case, a LabVIEW string ) is displayed in a dialog window that stays open for 2 seconds. The dll is called in its own thread so it does not hang the UI thread. Refer to the "Using External Code in LabVIEW" manual for more information about the function.
    The example was developed in LabVIEW 7.0 and the DLL in VC++ 6.0. Hopefully, this example gives you a good start!
    Regards,
    AE Sulzer
    Applications Engineer
    National Instruments
    E. Sulzer
    Applications Engineer
    National Instruments

  • Digital barometer to be integrated with Labview programme

    Hi,
    Does anyone have any recommendations for a digital barometer that could be integrated into an existing NI data acquisition system and Labview 8. Ideally I'm looking for a barometer that can connect to the acquisition hardware we have currently and provide a real-time readout of the ambient pressure within the Labview VI we have currently (obviously some modification to this would be required). I've had a look around the NI website and can't find anything suitable, and Google turns up far too many results.
    Apologies if this is in the wrong forum - I was unsure which would be the best place for it.
    Thanks for your help.

    Dear Thomas
    Can I ask what acquistion hardware you have first of all? A barometer measures the static DC pressure and a recommendation I have is to use a compactDAQ or compactRIO board using a C Series Module; preferably a  NI 9237 or NI 9219. Both the NI 9237 and NI 9219 modules can power strain gages or pressure transducers. 
    A good link to the pressure sensors we have can be found here:
    http://zone.ni.com/devzone/cda/tut/p/id/3639
    Please let me know what acquistion hardware you have and I can advice how best to set this up.
    Many thanks for using the NI forums and I look forward to your reply.
    Kind regards
    David
    Applications Engineer
    National Instruments UK

  • Translate C code into LabVIEW

    Hi, I have a function in C/C++, and I am wondering how I can have it translated into LabVIEW.
    Thanks,
    Andrea

    There are three ways to use the code in LV.
    First create a DLL or .Net assembly and call it from LV.
    Second use a Formula Node. You can enter your C code directly there.
    Third rewrite the code in LV.
    Which is approiate will depend on your Code.
    Rewriting in LV will cost most work and you need to have a good experience in programming in C and LV.
    Most language constructs of C are available in LV but not all, e. g. there is no while loop. The While loop in LV is a do { ...} while loop. It will execute at least once. For a while loop you must use a Case with a containing While loop. since your termination expression must be used twice create a subVI for it.
    Another thing which will go not easy to handle is the switch statement. Basicly the Case structure is the same but you must take care of the following code in C:
    case <value1>
    case <value2>
    break;
    case <value3>
    break;
    You must handle this by additional nested Case structures.
    Most runtime functins are available or can be build using two or more LV function, e. g. fprintf can be created by Format Into String followed by a File Write.
    If your code contains functions pointer thats no problem. VI references are function pointers. Open VI Reference creates a function pointer and Call by Reference uses it.
    Since you are mentioning C++ you may need to have a look to the object oriented programming in LV.
    OK, I'm the last one, but Ihe written the most text and some hints.
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • Help with reading information coming from a software into LabVIEW through Serial port

    Hi,
    I am new to LabVIEW and also an amateur in using RS232 for communication. I have this software that has these icons like speed increase/decrease, elevation up/down, start/stop. Now, when I click these buttons on the software, they perform the appropriate functions. For example, if I press start button, the signal must go through a serial COM port into LabVIEW to start the machine. How do I do that? How do I find what format the code word is when I press a button on the software? And how to decode the information to read whether the button pushed is start etc...? Any help would be appreciated.

    I may not be perfect, but I'm all I got!

    That information would be in the programming manual for the device you're controlling. Unless you have a device that has no documentation or you cannot get the documentation that's the first place you should look. If you cannot get the documentation at all then you've got some reverse-engineering to do. To do this you will either need a serial port sniffer (a hardware device), or you can try to use a software-based port capturing program. On Windows PortMon is the most prevalent. This will show you how the port was configured (baud rate, stop bits, etc). Warning: the information is technical.
    As far as how to get it running in LabVIEW, you should take a look at the serial port communication examples that ship with LabVIEW. The most problems occur in figuring out how to (a) terminate a write command, and (b) determining when to stop reading. For (a) this is typically done by appending a carriage return or linefeed to the command. This is device dependent. For (b) this is usually done by the byte stream ending with a character like a linefeed. Again, this is device-dependent. 
    You may also want to peruse this KB article: Serial Instrument Control Tutorial. There are also lots of tutorial on the internet for basic tutorials on serial port communication.

  • Way to acquire more than one sample at a time into Labview from cFP?

    In reading data from my cFP into Labview I see that I can use the FP Read.vi but it only grabs one sample per call (loop iteration).  In other devices, I could just use the AI Acquire Waveform.vi to grab multiple samples per call.  Can I use this for cFP?  Is there another way to grab more than one sample per call from my cFP?  I'm just running it from a host computer, not using RT.
    My specific problem is that I have two things I want to do with the same signal, one slow (PID control loop) and one fast (data logging).  If I put the FP Read.vi in the same loop as the PID control, I can only get one sample in the time it takes the PID loop to run which is too slow.  I'm trying to think of ways around this problem.
    Thanks,
    Hosehead

    Hello Hosehead,
    With FieldPoint there is no way to acquire more than one same at a time like
    you can with NI-DAQ.  With the FieldPoint read and write VIs
    you can only read or write a single point at a time.
    Please see the Sampling
    Speed of FieldPoint Modules document for more information on cFP
    acquisition rates.  This document explains how channels are updated, how
    often the data is updated, and what happens if you miss samples.  Please
    note that you will be able to acquire more samples if you are running your
    application on the RT controller and not on your host computer.
    If this does not answer your question, can you please post more data about the rate
    you want your PID loop and your data logging loop to run at.
    Regards,
    Jesse O.
    Applications Engineering
    National Instruments
    Jesse O. | National Instruments R&D

Maybe you are looking for