Ethernet/IP in LabWindows?

Has anyone done anything with Etherent/IP within LabWindows?  Is there a third-party library that will accomplish this?

Hi Hendra, 
We have an ethernet/IP toolit but it doesn't have a c-api. 
you can: 
1) look at wrapping the labview toolkit in a dll. We have done so sucessfully for other applications, like Veristand. 
2) Use an OPC server solution, which is slightly more complicated. You need to 
a) Use NI OPC servers, which are a part of the DSC module, to connect to the PLC. We should have an OPC server that supports an ethernet/ipc connection for your PLC. I would be your PLC supports other types of connections also.
b) Connect to NI OPC servers from CVI through data sockets. 
OPC servers will be pretty slow performance-wise but they may have other advantages, such as easier debugging and configuration, that give them an edge. 
Either way post back what works for you. I feel people get lost trying to implement systems like this and having a working system outlined would help immensely. 
Jesse Dennis
Design Engineer
Erdos Miller

Similar Messages

  • CNVString - Sending Strings from a PXI chassis over ethernet to a labWindows application on another computer

    I have a PXI chassis with a PXI-8101 controller. It is set up with a realtime operating system. I am communicating to it with a PC with a Windows operating system. I am trying to send variable length string messages from my PXI system to my PC.
    On the PC I have a LabWindows application which can send and receive data with the PXI system. I am attempting to send error messages from the PXI system to the PC on ethernet. I am able to send numerical data between them but not the string messages. The PXI software runs to the function call CNVCreateArrayDataValue() and steps into it but never returns. It only has this problem when the parameter CNVDataType is CNVString; when I change CNVDataType to CNVBool it does not have this problem. I am new to this PXI realtime so would appreciate the help. Below is the code on my PXI system which sends these text messages.
    In the beginning of RTMain I create the Writer
          CNVCreateBufferedWriter("\\\\localhost\\system\\" REG_CAL_ERROR_STRING, 0, 0, 0, 64, 5000, 0, &gErrorPublisher);
    Then I call a function with a string in the parameter list:
    void SendRT_ErrorMessage(char* message)
          CNVData data=0;
          int error;
          char error_str[256];
           int i;
          char out_str[ERROR_STRN_SIZE*4];
          strcpy(out_str,message);
          size_t arrayDims= ERROR_STRN_SIZE;
          arrayDims= strlen(message) +1;
          error = CNVCreateArrayDataValue(&data, CNVString, out_str, 1, &arrayDims);
          if(error<0)
                strncpy(error_str, CNVGetErrorDescription(error),256);
    //    CNVPutDataInBuffer(gErrorPublisher, data, 1000);
          CNVSetArrayDataValue(data,CNVString,out_str,1,&arrayDims);
          CNVPutDataInBuffer(gErrorPublisher, data, 1000);
          CNVDisposeData(data);
    Solved!
    Go to Solution.

    I've changed things around and now the application on the realtime operating system on the PXI-8101 does not hang but my host computer does not see the message correctly. It sees some characters but they are not what I sent.
    I don't seem to be able to get message out of CNVData data properly. Below is the new code for the PXI-8101 controller and the Host computer LabWindows application.
    Here is the code in the PXI-8101 controller now:
     CNVCreateWriter("\\\\localhost\\system\\" REG_CAL_ERROR_STRING, 0, 0, 5000, 0, &gErrorPublisher);
    void SendRT_ErrorMessage(char* message)
     CNVData data=0;
     int error;
     char error_str[256];
      int i;
     char out_str[ERROR_STRN_SIZE*4];
     strcpy(out_str,message);
     size_t arrayDims= ERROR_STRN_SIZE;
     arrayDims= strlen(message) +1;
     error = CNVCreateScalarDataValue( &data,CNVString,out_str); 
     if(error<0)
      strncpy(error_str, CNVGetErrorDescription(error),256);
     CNVWrite(gErrorPublisher, data, 1000);
     CNVDisposeData(data);
    And here is the code in the Host computer LabWindows application:
     sprintf(path, "\\\\%s\\system\\%s", address, REG_CAL_ERROR_STRING);
     CNVCreateSubscriber(path, ErrorMessageCallback, 0, 0, 10000, 0, &gErrorMessageSubscriber);
    static void CVICALLBACK ErrorMessageCallback(void * handle, CNVData data, void * callbackData)
     char message[ERROR_STRN_SIZE];
     CNVGetScalarDataValue(data,CNVString,(void *)message);
     (void)SetCtrlVal(panelHandle,PANEL_TEXTBOX_DEBUG_MSG,"got something\n");
     (void)SetCtrlVal(panelHandle,PANEL_TEXTBOX_DEBUG_MSG,message);
     (void)SetCtrlVal(panelHandle,PANEL_TEXTBOX_DEBUG_MSG,"\n");
     CNVDisposeData(data);
    You can see that I output a message "got something" so that I know I got the callback but the next line is a gibberish message "HÊl "

  • Communicating with a device using labwindows 7.0 and ethernet

    I am new to this type of communication, and I was just wondering how you would accomplish something like that.
    Derek

    Derek,
    Please see/post to the following thread:
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000B0E80000&UCATEGORY_0=_318_&UCATEGORY_S=0
    Ames
    Applications Engineering
    National Instruments

  • Ethernet data

    Hi everyone,
    I am evaluating Labview for my company to see if this is a product that we can use.  I'm confident we can get this to work, I'm just not confident in my Labview abilities yet and I need to create a working app for management to review.
    Here is an overview of what I'm trying to do:
    I need to create an application that, for all intents and purposes, is a data viewer.  I need to gather data from a network, via UDP, and display the data in various output fields, graphs, charts, ADI's etc...  The main issue I see is that I need to bring in large amounts of data, up to 2 MB in some instances, parse this data out, run some algorithms, and then display the result.  The incoming data will be a mixture of char, short, int, floats, and doubles.  We will have multiple display pages within our VI (we will probably use tabs) where a single parameter can be displayed in multiple pages.
    What I have done so far:
    I can read a packet of data into my VI with the UDP read (awesome and quite easy tool to use).  I can take the data and parse it out into an unsigned byte array.  I have also experimented with the Unflatten from String function into an unsigned 1-dimensional array of shorts (I wanted this to be a 1-dimensional array of bytes but couldn't figure that out) and then convert that array to a named cluster to parse the data.  I can successfully see the data coming in and can manipulate each piece.
    I am hoping that someone can kind of point me in the right direction on what tools would be best to use and where to start.  I have looked through the forumns and online to try and find some examples of best practise for dealing with large amounts of data but I haven't had any success.  I'm also not asking anyone to extensively write anything as that would take away my fun.  So, here are my questions:
    1.  Is there any easier/more logical way of bringing in large amounts of data to manipulate?
    2.  Is there a simple way to change the data to signed data, which would save me a lot of conversion routines?
    3.  Is there a way to bring data in and dynamically (before runtime, so dynamically might not be the most appopriate word here) set that up to a known structure?  (I have an ASCII text file with the structure of the data which includes the parameter names and data types)  This way, I could change the structure of the data in the text file, and the VI would resize appropriately without having to realign the 350 or so parameters if we inserted something in the middle.  I would like to use something like the System.Collections.Generic Dictionary class in C# so that I can access a variable by name instead of by array index.
    4.  Would it be better to attempt to write a .NET assembly to handle this, or possibly LabWindows?  (I'm still not exactly sure everything that LabWindows can do or should do)
    Thanks in advance for your help.
    Stephen Jenkins

    Thanks for the reply Patrick,
    We have our business model set up in such a way that some initial Sun workstations process, store, and then pass the data onto another set of PC's in the form of ethernet data.  The ethernet data is packaged up at 10 sps, while the original data to the Sun stations has a much faster incoming data rate.  This being said, we aren't worried about extremely reliable data transfer to the PC's running Labview as all the data is stored in its raw format prior to Labview.  We use UDP because we have a variable amount PC's listening to this broadcast and don't want to worry about the overhead of TCP/IP.  It is quite possible that we could replace our Sun Stations with Labview, in time.
    After becoming more familiar with Labview, I can see that question 2 about signed data was a little premature.  The signed data is no longer an issue.
    The ASCII file just gives us the type and structure of the incoming data so we that know how to accurately parse and display that information.  The data is stored prior to Labview on the Sun workstations.  Labview will be used to run some algorithms and display the information real-time, in a human readable format.  From what I can tell, it will be easier for us to write a .NET assembly that will give us the ability to bring the data in through a constructor and property node.  The property node then has the named parameters, instead of an indexed array, which is easier to read and troubleshoot.  This gives us sort of the same functionality that a Systems.Collections.Generic Dictionary object would.  This is what we prefer as we will be bringing into the Labview application anywhere from 50 to 3,000 parameters at a time, which create rather large lists to deal with.
    For question 4, I guess I feel comfortable writing .NET functions to handle certain things and not quite as comfortable in Labview yet.  Eventually, as I become more familiar with Labview, I will migrate everything over.  I ask this question as I am used to using .NET tools and was curious to see if such tools were also available for use in Labview, such as Dictionaries.
    I can see quite clearly that we aren't using even 10% of Labview's power, but that should change as we become more comfortable with it and discover more of its potential.
    I started this thread as I couldn't find any really good examples for handling large amounts of ethernet data in Labview and was hoping to be pointed in the right direction as to which tools would be best utilized and what would be best way to go about it.

  • Kollmorgen AKD modbus or Telnet over ethernet TCP

    I'm a beginner using LabWindows CVI. I have a Kollmorgen AKD driver that can communicate via Ethernet using either Telnet or Modbus protocol. To make sure the hardware works, I downloaded the Kollmorgen WorkBench Software onto my laptop and went through the QuickStart guide. I set my laptops address to a static id (192.168.0.100) and then set up the Kollmorgen driver to have a static id of (192.168.0.26) using the two rotary switches (S1 and S2). In this case, I chose 2 and 6. I connected my PC to the driver using the Workbench software and was able to successfully spin the motor ccw and cw. I also was able to move the motor to specific locations (90, -90, 180, etc) in relation to the set 0 position. The Kollmorgen software uses the Telnet protocol.
    How would I go about connecting my PC to Kollmorgens AKD driver using Modbus/Telnet via Ethernet on LabWIndows CVI? Is there a modbus library or special functions?
    I went to the Modbus website and did not find any examples...
    Any help would be much appreciated.
    Badra

    There are free LabVIEW Modbus libraries, but these are API's built for LabVIEW:
    http://zone.ni.com/devzone/cda/epd/p/id/4756
    https://decibel.ni.com/content/docs/DOC-30140
    There actually is a push to implement Modbus protocol support in CVI, and you can add your thoughts to the discussion here:
    http://forums.ni.com/t5/LabWindows-CVI-Idea-Exchan​ge/Implement-Modbus-RTU-TCP-protocol-support/idi-p​...
    The Idea Exchange forum is used by R&D in order to help implement new features requested by customers in later releases. You can also try using a free C library that does Modbus protocol, since CVI utilizes C code. An example would be libmodbus:
    http://libmodbus.org/documentation/
    There is also this community example which implements Modbus RTU programming over RS232 in CVI:
    https://decibel.ni.com/content/docs/DOC-15734
    Daniel K | NI Applications Engineer | Certified LabVIEW Developer

  • TCP using LabWindow/CVI ? ?

    Hi !
    I'm looking for ways to learn & use "TCP" communication ( Client /
    Server ) together with LabWindows/CVI.
    ( all examples at your site are for LabView only )
    Can you please let me know where to find an TCP Client / Server
    applications examples for LabWindows/CVI ??
    If posible i'll like the exact addresse of pages contains this
    examples/information !
    Also if posible i like to know if there is something about Ethernet or /
    and Lan ( Local Area Network ) in the LabWindows/CVI.
    I want to add that i know about the TCP Client/Server example in the
    LabWindow/CVI - Samples, but it is not complete - it is only a skeleton
    which not explain
    it all.
    I also want to know about the hardware i need to establishes a TCP
    connection !!
    Which cable should i use to connect the Server & Client computers ?
    Where exactly should i connect the cable in the computer ?
    It very importent for me to get full answer as soon.
    Thank you very much !!
    Regards
    Noam G.

    I would also like to see these examples, but I can help you on some of this. You don't really need any hardware (since you are accessing this site, I assume you have an ethernet card). For a cable, if you are connecting both computers to a LAN or the internet (direct or via a hub) use a RJ-45 ethernet cable. If you are connecting the computers directly to each other, you must use an ethernet crossover cable. The cables just connect into your ethernet port (where your internet access is plugged into now).
    Go here for more info on a crossover cable:
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/38528df7b4d1feae86256dcf0069b14d?OpenDocument
    Derek

  • Communicat​e with cFP 1804 on Ethernet with Microsoft C

    I don't want to use LabVIEW or LabWindows to communicate via ethernet or serial to cFP=1804 I want to use Microsoft C C++ 6?

    Yeah I know we have programmed the device in LabVIEW/LabWINDOWs  but in this particular case it needs to run in the same project with all the legacy code in MS C\C++ 6 and we need to keep it lean and mean so we prefer just using the FieldPoint DLL in the project as we do with DaqMX.dll  but it seems that doesn't work perhaps due to some kind of data exchange with NI MAX.
    We tried using the code that works in LabVIEW and generating a DLL .h and .lib files and calling it from MS C\C++ 6 application but it seems as though it was executing the code in the DLL but not actually communicating with the Field Point modules/controller. 
    thanks for any help at this point!

  • Test NI cDAQ-9188 using LabWindows/CVI

    I am looking for help to create test for cDAQ-9188 with DIO and AIO modules.
    Would you please advise with information as follow:
    1. Adding device driver to a project.
    2. Sample of UI.
    3. Sample of test script for DO (AO) control.
    4. Sample of test script for DI (AI) acquisition.
    Thank you.
    Sincerely,
    Sam.
    [email protected]  

    There is a tutorial on using DAQmx with LabWindows/CVI here: http://zone.ni.com/devzone/cda/tut/p/id/2931. That is probably a good place to start.
    Another good article to check out is the NI Ethernet Data Acquisition Overview here: http://zone.ni.com/devzone/cda/tut/p/id/7374.
    As far as examples go, there are several text-based examples (as long as you have DAQmx installed) located at: Start Menu >> All Programs >> National Instruments >> NI-DAQ >> Text-based Code Support >> ANSI C Examples. 
    National Instruments

  • How do I add an airport extreme to a cable modem with only one ethernet port, while keeping that port connected to my Mac?

    I have a mac pro connected by ethernet to a cable modem via ethernet.    There is only one ethernet port on the modem.   
    I want to keep the Mac connected via ethernet for speed.    Is there a way that I can add an airport extreme to this set up - for my ipad and roku, and for guests to use - or do I need to buy a router to put between the modem and the mac?
    If I need a router, what kind?
    Thanks.

    The modem connects to the WAN "O" port on an AirPort Extreme router.
    The Mac Pro connects to one of the three LAN <-> ports on the AirPort Extreme router.
    Or if you do not need the ability to connect a hard drive to the USB port on the router, you can save a bit by using an AirPort Express.
    The modem connects to the WAN "O" port, the Mac Pro connects to the LAN <-> port
    Either the AirPort Extreme router or AirPort Express router will allow up to 50 wireless device to connect.
    There are many other wireless modems offered by other manufacturers as well.

  • GPIB Ethernet/1​00 Performanc​e

    Does anyone have some real world peformance measurements on the transfer speeds of the NI GPIB-Ethernet/100 box. I am very disappointed in the performance of a block read which is approximately 6ms/byte transfer (tested from 20 bytes to 32kbytes block transfers). This is on a 100 Mb Ethernet. I can ping the box with 64 byte round trip transfers at ~0.7ms/packet.
    I almost feel that the GPIB-Ethernet Box is not buffering my GPIB transfers.
    Thanks

    Actually ignore my question. My transfer speeds are ~6 microseconds/byte (not milliseconds!). This is still a little slower than I would like, but not totally unreasonable! Note the vertical axis in the included plot (pdf) is in ms, so the linear coefficient in the fit equation is 13 microseconds/(16 bit word).
    Attachments:
    GPIB_ENET_Plot.pdf ‏25 KB

  • I have a TC which is connected wirelessly to my router.  I would like to connect a mac in another location via ethernet to the TC.  I can't seem to get it to connect.  Am I missing something?

    I have a virgin Superhub which serves my wireless needs throughout the house.  I have a Timecapsule which connects wirelessly to the router with no issues.  I can backup my MBP over wireless easily.  I have now got another machine in a different part of the house that I would like to connect to the network.  It doesn't have wireless so ethernet is the only option.  I have a number of options 1) run cabling - not really possible  2) buy a powerline network system or 3) use the timecapsule to connect to the network/internet. 
    I like option 3 because
    (a) - I don't have to spend any more money and
    (b) - my wife wont complain about cables also see (a)
    Should using mixed wifi and ethernet clients on a timecapsule work?  if so is it a feature I can use out of the box so to speak?
    Thanks

    Should using mixed wifi and ethernet clients on a timecapsule work?  if so is it a feature I can use out of the box so to speak?
    Thanks
    No a TC cannot do what you want.. it is now in dumb stupid wireless join mode.. and it turns off the ethernet ports.. in case you want to use the TC as a wireless bridge to multiple clients which is plainly wrong.. (only airport express is allowed to do this since it has only one ethernet port).
    Welcome to Apple. (The plainly wrong above is a figment of Apple imagination.. of strict network protocols.. but unhelpful for a home device. maybe also to encourage sales of expresses.)

  • Blue screen error when connecting an ethernet cable

    I have a Compaq Presario 5300US desktop that I'm trying to upgrade.  It has 512mb (max) of memory and a newer video card than the factory one.  I installed Vista Home Basic on it with no problems.  I also installed a pci ethernet card along with the Vista drivers that came with it.  I checked tha card's properties in "device manager" and it said "This device is working properly".  I haven't plugged in an ethernet cable to the card at this point.  Everything is working OK, but as soon as I try to connect the card to my router, I get a blue screen with this message:
    Hardware Malfunction
    NMI: Parity Check / Memory Parity Error
    *** The system has halted***
    I don't get any memory errors as long as I don't try to use the ethernet card.

    Hello @larrycarol99,
    I understand that after upgrading your computer when you plug in an ethernet cord you get a hardware malfunction error. I am providing you with a Microsoft Support document: Hardware Malfunction Results in System Error Message that explains what causes that error and provides steps on fixing it. I am also including a link to the Compaq Presario 5300US Desktop PC Drivers page, which unfortunately does not have any drivers for your computer running Windows Vista.
    I hope this helps. Thank you for posting on the HP Forums. Have a great day!
    Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
    Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
    Dunidar
    I work on behalf of HP
    Find out a bit more about me by checking out my profile!
    "Customers don’t expect you to be perfect. They do expect you to fix things when they go wrong." ~ Donald Porter

  • Ethernet to USB adaptor no longer being recognized by my mbp

    I have an older macbook pro, which is running mac os x 10.5.8. The ethernet port is broken so I have been using a mac Ethernet to USB cable because there is no wifi at my college. I got the cable to work for a while, then I unplugged it and my computer no longer recognizes it. When I used to unplug it and plug it in I would get a message by the airport symbol that said something along the lines of ( new network usb-ethernet availible, which then would allow me to go into network preferences and give me the option to connect to the usb ethernet).  Now when I go to setting with the usb ethernet device plugged in I no longer get the option to use usb-ethernet adaptor, and cannot connect to the internet.
    Both the cable and port have been tested and they both work. I also havn't installled any new software recently so I have no idea what I have done wrong.
    Thanks for your help

    Hi Dibenkorn,
    Yes, both USB ports are not recognizing this lacie external hard drive. I also tried the SMC reset but that did not change anything. I have another external hard drive (smaller one) and it works on this computer fine and like I said before the Lacie works fine on my other (older) MacBook. I just can not figure out what went wrong or what happened...

  • HP Color LaserJet MFP M476dn - Impossibly slow ethernet

    Win7 - 64 bit on typical small office network setup (Comcast internet, Linksys Router, half computers on wifi, half wired).
    Upgraded from terrible old Brother multi-function printer.
    We print some files from remote desktop (using redirected printers.. as in, the remote desktop session has the ability to print through our computers to our local printer).
    Sometimes the files are large (10-20mb).. and the Brother printer sends it right over in about 1 second.
    New HP Color LaserJet MFP M476dn goes as slow as you can imagine.. I can sit a watch the printing dialog box and watch it 256kb........512kb........768kb.......... out of 15mb.
    I have tried a bunch of combinations of different drivers (PCL5 etc), link speeds on the printer, RAW processor, Port types, and so on, but can't find the right combination..
    I should mention that we are using the exact same ethernet cord as the old Brother printer. Also, the HP is set to a Static IP.
    Please help!
    Thanks,
    Eric

    I had this exact problem. I've had the printer for about a month and it was very fast at first. I really like the printer, especially the duplex ability. Over the past week or so it became excruciatingly slow. I just finished downloading the new firmware and drivers but before installing them something made me check the Ethernet cable which is plugged into my Airport Extreme 802.11n Gigabit router. It was loose and partially pulled out so I plugged it back in all the way and the printer went back to printing the way it is supposed to.
    You might want to give this a try. Perhaps try another Ethernet cable or direct connection via USB if that doesn't work.
    Frank

  • How to print on HP LaserJet 2200 over Ethernet?

    Hi,
    I did an upgrade to Snow Leopard and would like to print on a HP LaserJet 2200 over Ethernet. OS X and the HP printer drivers are up to date now.
    The printer has been cold reset and on the configuration print out there's the IP address 0.0.0.0
    Now my question is how to get this printer to work with Snow Leopard over Ethernet? I did not find a tutorial how to assign an IP address to the printer first so I got stuck.
    Could you give me a hint where I should start with the configuration first?

    OK, now the printer works
    I reset the router and checked if DHPC is running.
    I reset the printer (hold down the GO button, turn the printer on and continue to hold the GO button for five to ten seconds).
    Checked at router that the printer is visible as network device.
    At the router I assigned a fixed IP address to the printer.
    At OS X System Preferences > Printer I added a new printer with "HP Jetdirect - Socket", the fixed IP address and the correct printer driver "HP LaserJet 2200".
    Now the printer has been recognized well by the system (Tray 3, Duplex and printer RAM) and printing works.
    THANKS.

Maybe you are looking for