Fast low level Ethernet communication with LabVIEW
Hello, I want to read Ethernet packets with LabVIEW (an private protocol, not UDP or TCP or others). The hardware writes 40 000 packets per second. I want to use winPcap API to capture data. I’ve seen the example «packet_sniffer_project » (and others). It’s an great job. But the soft reads only 1 packet at each time (wrapper dll calls « pcap_next_ex » function) and I lose packets. With my computer, I read 25 000 packets per second. How can I read more than one packet at each time? (or all the Ethernet buffer) Thank You
Micke
Hi,
maybe an example that I posted will help you
http://decibel.ni.com/content/docs/DOC-11373
cosmin
Similar Messages
-
LabVIEW low level Ethernet communication, 802.3 physical layer
I'm trying to use LabVIEW to establish communications with a Freescale
8270 PowerPC CPU with built-in 802.3 Ethernet. The microcode on the CPU
end supports only the 802.3 MAC/PHY layer (with CSMA/CD). We will not
be implementing a TCP or UDP stack in the CPU code. It appears that the
built-in LabVIEW functions communicates with Ethernet through the TCP
and UDP stacks only, which in turn call the windows API. LabVIEW does
not access the Ethernet 802.3 physical layer directly at all. So, there
is a gap in the communications between the two. I do not need a lot of
networking functionality, this is only for a simple continuity test
(CPU sends a test message, LabVIEW displays it). Any LabVIEW code
examples or app notes would be helpful. Thank You, Larry Junek
([email protected])See this Link where it sounds like Bim has already cracked that nut.
http://forums.ni.com/ni/board/message?board.id=170&message.id=206697#M206697
Ben
Message Edited by Ben on 09-26-2006 11:19 AM
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
OBD1 ALDL communication with Labview VISA
Hello all,
I am new to serial communication with labview.
Task:
trying to send a command and receive data from a 1987 corvettes ECM using VISA serial block in labview.... and failing hard
Troubleshooting the problem:
Hardware: works with EFI live V4 (software that communicates with cars), send and receives data all day long, so my hardware is not the problem
software: it is something i am doing wrong in my coding
Example code form EFI live V4:
37:30.137: Send: $80,$57,$01,$00,$28
37:30.137: Finished writing frame
37:30.137: Wait 10 ms after writing, before reading...
37:30.147: Start reading frame
37:30.147: Aldl frame header byte: $80
37:30.147: Aldl frame length byte: $57
37:30.147: Recv: $80,$57,$01,$00,$28
37:30.147: Finished reading frame
37:30.147: MAX232 echo: $80,$57,$01,$00,$28
37:30.147: Wait 10 ms after writing, before reading...
37:30.157: Start reading frame
37:30.160: Aldl frame header byte: $80
37:30.160: Aldl frame length byte: $95
37:30.241: Recv: $80,$95,$01,$1E,$5B,$00,$00,$00,$00,$00,$44,$44,$1D,$00,$9C,$D6,$00,$00,$FF,$66,$00,$80,$80,$00,$80,$64,$80,$FF,$00,$80,$00,$27,$27,$00,$00,$00,$77,$00,$3A,$00,$43,$00,$00,$00,$00,$00,$00,$00,$00,$01,$BD,$00,$00,$00,$00,$00,$00,$D5,$2A,$22,$00,$07,$00,$00,$0C,$00,$DE
37:30.241: Finished reading frame
Example code protocol i tryed into the visa block in labview:
$80,$57,$01,$00,$28
$80,$57,$01,$00,$28\n
$80,$57,$01,$00,$28\r\n
$80$57$01$00$28
$80$57$01$00$28\n
$80$57$01$00$28\r\n
80 57 01 00 28
80 57 01 00 28\n
80 57 01 00 28\r\n
8057010028
8057010028\n
8057010028\r\n
VISA read Result:
i just get an eco back of the same command i sent
Question:
is there something simple i am missing in the command protocol or a possible setting i am overlooking?
also what is the purpose of the “$” in the Hex command?
background info:
vehicle : 1987 corvette
ECM type: 16198259
com. protocol : ALDL OBD1
labview v8.5
baud rate: 8192
data: 8 bit
parity: none
stop: 1
buffer size: 256Are you actually supposed to be sending hex? You need details on the actual format of the data. I don't think viewing the output of some other program will tell you what is truly being sent and received unless its a sniffer such as portmon.
You can right click on the string control and select hex display. You also did not include the actual VI so no one knows if you have it set to send \r and \n correctly. -
Ethernet communication with NI9149
Hi everyone,
I would like to create a rugged system by interconnecting several units by means of Ethernet for a measurement and control application. My question is if I can connect NI9149 chassis over the ethernet directly for control and communication with the modules attached to the chasis and application or is required an additional ethernet controller for each unit. The application is created in Measurement Studio. The system diagram is presented in attached file. Thanks.
Attachments:
Untitled.png 26 KBThe 9149 gives you direct access to I/O using a technology called shared variables, which should be accessible from measurement studio. Shared variables are a peer-to-peer protocol meaning you just need to connect the 9149 to your network and you should be able to get data.
However, shared variables are lossy and have a maximum rate -- I've seen something on the order of about 50-100 Hz update rates mentioned in various locations, although performance will be application and network specific. If you need faster performance you will have to use a FIFO (allowing you to stream data) and you will have to program the FPGA using the LabVIEW FPGA module. I believe you should be able to interface with the FPGA but it will require using the LabVIEW FPGA C interface and you must be able to call the dll from measurement studio. There may be an easier mechanism I am unaware of.
You may also consider ethercat for your application which does require a separate real-time host but is also a faster protocol. A good comparison of options is here: http://www.ni.com/white-paper/14151/en/ -
Tcp/ip communication with LabVIEW
Does anyone have experience building an application with LabVIEW that
communicates over a socket? I new to LV, but it appears that the
application I have in mind is possible. Specifically, the LV
application would open a socket (port and IP known ahead of time) and
send a character to that socket. Depending on the character sent, the
application on the other end (a UNIX process) would send back a one
integer value to indicate the number of packets to expect. The LV
application would next need to parse each packet for such things as the
packet length, data length and so forth and then distribute those data
to appropriate sub-processes. The header value types are integer,
double, byte and character. The data values are all 4-
byte integers.
The sending code (on the UNIX side) was written in C. The aggregate
throughput is relatively low; no more than 2,000 bytes per second,
including packet headers.
If I can get this to work, the results would represent a significant
cost savings over competing alternatives. As a federal employee, I'm
always looking for the most cost effective solutions.
Thanks.
-Robert
Basically, I'm just looking for confirmation that this sort of thing is
possible with LV. And, I'd like to get a better idea of how hard it
would be to do.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.Hi everyone,i am currently trying to communicate with two computers at the moment using TCP/IP.I have done a simple server and client VI but the server doesnt seem to be writing the string im trying to send and it also gives an error message
Error 1 occurred at TCP Write in Server.vi
Possible reason(s):
LabVIEW: An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
Please find attached the simple server and client VIs i have done.can you help me?
Thanks
Osowoaji
Attachments:
Server.vi 13 KB
Client.vi 13 KB -
TCP/IP communication with LabVIEW Full?
Hi,
I would like to know if the TCP/IP VIs are included with the Base or Full version of LabVIEW?
I was looking at the different versions of LV and one of the features of the Pro version is 'Network Communication'.
I have done TCP/IP communication a while ago and I am quite sure it was with the Full version. I have the Pro version now but this is for a customer.
This brings another question: Is there a trick to be sure your code is going to work on a system with LV Base if you develop on a system with LV Pro?
Thanks!I think that was a good answer to your first question. To answer your second question, if you are creating executables to be run on a computer with LabVIEW Base there will be no problem running the executable because LabVIEW Base has the run time engine. If you are sending VIs to another computer with LabVIEW Base they will not be able to access any VIs that are not included in there package. There is no simple way to tell that these VIs are not included except through the link in the previous post. In LabVIEW 8.6 many of the help documents state what LabVIEW package installs the VI. If all of the VIs state that they are installed with LabVIEW Base you will have no problems.
Vince M
Applications Engineer -
How to use a namespace in a C++ code communicated with labview
I have a long code written in c++. Now I want to acquire data with labview, send some data points as an entry to my c++ code and it will return a value to Labview. I tried with a simple sum of two elements and it worked, but in my long code I have so use some namespaces and subfunctions. If I try to compile it does not accept a namespace such as std.
Can anybody help me?I'm not certain the difference (and there isn't an attachment). However, if the functions you are exposing from your DLL are not marked as extern "C", then you'll have a lot of difficulty calling it from LabVIEW. You don't want to deal with the C++ name mangling, so keep the API simple and straight C. Behind the function signature, however, you can use whatever you want.
If you are already doing this, can you answer the following
1. What, exactly, is going wrong?
2. What version of LV?
3. What version and platform is the C++ compiler?
Brian Tyler
http://detritus.blogs.com/lycangeek -
Ethernet connection with labview using Modbus
I want to communicate via Ehternet connection with LabVIEW using modbus protocol, Just as RS232 (COM) coomunication wiht Modbus in Labview.
miniSee these threads.
http://forums.ni.com/ni/board/message?board.id=170&message.id=151337&view=by_date_ascending&page=1
http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=F1582737BACF5CA8E0340003BA7CCD71&p_... -
Ethernet Communications with a Rockwell Reliance VFD
How can I communicate with and control (read from and write to drive parameters) a Rockwell Reliance VFD (SP600 / GV6000) with their Ethernet/IP Communications Module - M/N RECOMM-ENET from Labview ?
Hi Dennis:
Ultimately I believe you will want to use VISA. Have a look some documentation on how to use VISA with TCP/IP communication.
Hope this helps you out.
Emilie -
Reading data from mlx90129 rfid tag chip by using spi communication with labview?
Hi,
i have evb90129 evalution board in that mlx90129 chip and external memory (cat25128) and three external sensors are there, i am logging data from chip by using rfid reader it ok i am reading. at the same time i configured spi communication and i am trying to read data i am reading data from internal memory not from external memory i tried but i didnt suceed , now can i use labview to read data from mlx chip and external memory. for spi communication i am using sparkfunction atmega168 microcontroller and also i have spi to usb cable? now can i communicate or i required any devies? is it possible?
thanks in advance,
biji.I suspect the culprit to be the first parameter to your function actually. Calling another function requires the caller to allocate any buffer with a big enough size for the function to write something into. Allocate that array by using Initialize Array with U8 as type and the correct number as size. Pass this size also as read_length. While your code doesn't make use of this I think the third parameter to your function is either wrong or unnecessary.
As you use it now it is really nothing more than a local stack variable which you could declare inside the fucntion just as well. On the other hand what you probably want to do is have a function prototype like:
extern "C" _declspec(dllexport) unsigned char read_Sensor(unsigned *char read_data, unsigned long read_length, unsigned long *byte_transfered);
But you will have to do some modifications in your C code to support that parameter correctly.
That all said, doing the same in LabVIEW using VISA functions would have been done with about two VISA nodes, no DLL headaches and probably already long ago working.
Rolf Kalbermatter
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
Ethernet communication with E-series DAQ
I have several DAQCard-AI-16XE-50 PCMCIA cards. I have accessed them via ethernet in the past when they were installed in network connected laptops. Are there any NI or third party products that a PCMCIA card can be pluuged into that will connect to an ethernet network so I don't have to put several laptops out in the plant? I don't want to change everything over to Fieldpoint.
Wow, this is an amazing coincidence. I'm sure you were just about to give up hope on this idea. I'd read your post and was just talking with a friend of mine who had heard of this company, ViaSat, that produces such a device. So here's a link to the ViaSat MiniDAT. I don't know anything about it or what it's limitations are, but at least it's a start! Looks pretty nifty to me.
Russell
Applications Engineer
National Instruments
http://www.ni.com/support -
Hello all,
I am beginner in LabView and I am seeking help for the following:
I need to adapt a vi using a regular (analog) camera so to start using a USB camera instead. When I viewed the block diagram (which is really complicated for me) I noticed that the original programmer used the low level IMAQ VI's (e.g. IMAQ intil.vi and IMAQ configure Buffer.vi) to communicate, control and acquire images from the camera. Now, I am really confused, does these VIs work with all cameras? If not can I replace them with the IMAQ USB VIs'? How would this affect the other VIs that depends on the out come of the replaced ones? Finally, I would be glad if anyone can point out things to read so to acquire more knowledge about this subject?
I know I asked much but really I want to learn these things as fast as possible
Best Regards
MohammedHello TomBaum,
First, thanks for responding, really appreciate it.
Sorry that I cant send the Vi itself yet I have attached a picture of the part
that I want to modify (red rectangle).
All I want to do is using USB camera instead of the one used now! so does
these low level VIs work with the USB camera
or I should use the USB camera VIs which will mean that i will end up with many
broken wires since low-level VIs has
different number on inputs that the USB camera VIs
Hope this can give you an idea.
P.S. in case you will wonder about the sequence structure; it is only the
camera setting that I am interested and it is the one shown in the
structure
All the broken wires in the picture are going into a very larg while loop with
many other VIs.
Regards
Attachments:
pic1.PNG 48 KB -
Hi all,
I'm trying to do some very-low level USB control using Labview. Tasks are:
-Write 1 to output
-Write 0 to output
-Write clock to output.
Very simple tasks (no need to read, just write) , but i need to be able to do this with just a USB cable attached without any device. It will be used to characterize the cable.
The other end of the cable will be terminated appropriately.
If anyone could give me some information for me to start this, that would be extremely helpful.If you want to do something like setting the pins of a RS-232 port without a device attached, this will not work.
USB works fundamentally differently to RS-232. It is a point-to-point connection. It doesn't work open ended and you don't have direct access to the signal levels at all.
Look for a cheap I/O device instead and use it for testing.
Shane.
Say hello to my little friend.
RFC 2323 FHE-Compliant -
USB Communication with Cygnal Kit C8051F320-TB
Hi i am using Cygnal development kit C8051F320 - TB.
I want to communicate it with LabVIEW.
Some members in discussion forum earlier have posted queries regarding communication with LabVIEW to USBExpress development kit from Cygnal.
My question is, " is it possible to use same DLL (sif32xusb.dll) supplied with USBExpress with this kit ? " .
If anybody has tried then please send me vi along with firmware.
Thanking you
IshantHello Ishant,
Based in the excerpt from the USBXpress programming guide, you should be able to:
"The Silicon Laboratories USBXpress Development Kit provides a complete host and device software solution for
interfacing Silicon Laboratories C8051F32x microcontrollers to the Universal Serial Bus (USB). No USB protocol or
host device driver expertise is required. Instead, a simple, high-level Application Program Interface (API) for both
the host software and device firmware is used to provide complete USB connectivity."
It looks like aa1982 got it working on this post:
usb communication with silicon lab c8051f320
And both are using the C8051F32x series controllers, you may want to get in contact with the owner of that thread to see if he encountered any problems.
Xaq -
Lifelines trackit EEG recording with LabVIEW
Hi, I am trying to control a lifelines trackit EEG (www.llines.com) recorder using LabVIEW via serial communication (DB9). Does anyone has any experiences connecting this device with labview? I've done several communication via serial communication with labview before but not as tough and difficult as the current task. I am not able to understand the device (trackit) command in order for me to apply the Basic Serial Read and Write VI. Please advice. I have the Lifelines trackit recorder Interface specification in softcopy as reference but do not know how to attach here. Please let me know if you guys need the copy as reference. TQVM
Host Transmit Write Data and Write Command
[SOP] <AddrHi> <AddrLo> [Chr(W)] <ParamBlock> <Index> [EOP]
Or:
[SOP] <AddrHi> <AddrLo> [Chr(W)] <ParamBlock> <Index> [Data]# [EOP]
Or:
[SOP] <AddrHi> <AddrLo> [Chr(W)] <ParamBlock> <Index> <Data># [EOP]
Or:
[SOP] <AddrHi> <AddrLo> [Chr(W)] <ParamBlock> <Index> {Data}# [EOP]Is there a demo program from the manufacturer that works?? you can use portmon or NI spy to capture the serial datastream and reverse engineer the labview code. Sometimes ya have to think like a hacker.
http://technet.microsoft.com/en-us/sysinternals/bb896644.aspx
http://www.ni.com/support/gpib/max/nispy.htm
Message Edited by unclebump on 02-16-2009 08:34 PM
Maybe you are looking for
-
Sending Notification to a User (common box) without attaching an employee..
Dear all, I expect all of yours help on this doubt. I have created custom notification using wf_notification.send based on my logic, now I want to send these notification to common inbox in the Oracle. For this purpose i have created a user and attac
-
Creating a Zone with ufs?
Hi all, When you create a zone though Ops Center does it try and format the file system as ZFS? Can you make a Zone with a UFS? Thanks, Shawn
-
Could not find version number data in TF_BUILD_BUILDNUMBER
Hi, I'm using the default build process template TfvcTemplate.12.xaml that came with TFS2013. I'm trying to call ApplyVersionToAssemblies.ps1 (from the Community TFS Build Extensions) in the pre-build script to version assemblies. In lieu, I got this
-
How to customise portal tab (workset) name
Hi, I want to change the name of portal tab name. Like I want to change the standard sap delivered name system administration --> system admin and Content administration to Content Admin. Can any one help me how to do this? I will reward the points T
-
Enable Refresh Button/Menu in the Generated Report
Dear Experts, I have created a program that generates report based on the user defined parameters. My question is, how do I enable the Refresh button/menu in the generated report so that user won't have to back to the parameter screen and re-execute?