MODBUS RTU via TCP/IP
Dear all
I'm looking for a Modbus RTU on example TCP/IP VI. Does anyone have experience with this Protocol?
Please kindly give me some advice!
Thanks and greetings
Luong.Tran
Hello
Start herefor more information and the LV ModBus lib.
Kees
Tags: NI Products
Similar Questions
-
need help on modbus RTU: do not know the meaning of the other output registers
Hi all
I use LV 8.5, a programmer time & 1st novice LV to post msg in discussion, so please let me know if I missed something important.
In any case, I'm 2 power meter data acquisition (1st is CPM-50 model, 2nd is MWH - 10, the two brand ADTEK). the Protocol of these devices are modbus RTU. I have two targets to:
1 acquire data using RS - 485 (portable <-->meters of power)
2. acquire data using ethernet (laptop <-->converter series/ethernet <-->meters of power)
now I'm in the 1st part, I use the local brand USB-RS485 converter & I think that there is no problem in the port itself (past the loopback test). I create a program using LV samples Mo using w / these port settings: 9600, 8, N-1 as databit baud, parity, stop bit respectively (the same data format of the device: see page 17/42 of the manual). I use the query.vi series of MB that I customized to eliminate the error timeout 6101 (see attached photo).
Problem: I can read the right data into the output register , but is located in the 5th element of the 1 d array. In the peak of the attached example, I'm currently reading the baudrate of the device (see manual pg 26/42: address 0102 h = 258 d). so I read the 9600 w/c is correct. I also had the correct readings of other addresses of parameter which is also located in the 5th element of the 1 d array. Note: I never tried to read data from power because the meters are not yet installed in the cabinets of power (maybe installed nextweek leave)
Question:
1. What is the significance of the first four output records in my table 1 d of output?
2. why I got 5 output registers eventhough I'm asking only 1 quantity?
3 read the correct data in the 5th element normal?
I want to just be deleted in the data I read before jumping in part 2 (connection via ethernet). If I forgot some valuable information, let me know. Thanks in advance!
Kind regards
Ivel
-->-->--> -
Power Meter Modbus rs485 via 9871
Hello
I'm under Labview 2015
I'm currently trying to connect has the place D Pm820 (meter) NI 9871 module in a crio 9076. The project is supposed to read the performance data in the registers of the meter (current, voltage, etc.) using the port rs485 on the back of the meter.
The pm820 has a pinout for rs485 2-wire with 1 (-) 2 (+) and a 3rd Armor/ground wire. The pm820 meter is a slave device that has several different protocols that it can run on (Modbus RTU/ACII8/7 and JBUS).
The setting of the counter are:
Protocol: Modbus RTU
Address: 1
Baud rate: 9600
Parity: None
I use the module 9871 for device communication for the cRio
I use the power cord that came with the module 9871 RJ50 to db9 and have the pins 4 and 8 rider (TXD + TXD +), and then connected to the (+) 5 and 9 meter jumper pins (-RXD, TXD) - and then wired to the (-) meter and ground on pin 1. I have read, it's how wire you the db9 connection rs485 2-wire.
My first goal is just to get the communication with the power meter so that the value that I see in the registry, it is what I should see.
I started using an example VI for holding registers (master modbus on target RT) reading as labview was pre-constructed and changed it so that its contribution would be to port 1 on the 9871 as created controls for my run configuration. Other I left the rest of the VI that it has been opened.
When I run the VI I see numbers appear in the registry list, but they have nothing to do with the power meter. I unplugged the power meter and still got the same result however if you unplug the cable connection the 9871 1 VI will be a mistake (as expected). I have the feeling that the labview speaks to itself through the 9871, but I'm not sure. I looked at other posts, trying to find a solution and came across a mention of having to set the thread mode, but I can't find a way to do it using the modbus library. However I could not find an example reading VISA registers the using visa I see there is a way to do it.
I enclose a picture of my VI and the front panel to show what I mean.
If I could help either make my VI work or at least get pointed in the right direction that would be great. I'm not against the use of the Visa library either. Also if you have examples or resources that would allow that they would be greatly appreciated
It's just a part of my project but just get work communication is my main priority at the moment.
Thanks in advance,
Mike
-
Protocol Modbus RTU data types
Hello
I use series ADAM with the data type Modbus RTU protocol.which should I use to read and write operation?
-
Hello
I am trying to contact a Watlow F4D controller on a room using RS232. I use a cable converter USB-series and NI Watlow F4D Serial Driver.
The code of error-1073807339 occurs in:
Read in F4.lvlib:Utility MODBUS RTU Watlow VISA receive message-> Watlow F4.lvlib:Utility Register.vi reading
I don't know what caused the problem. I am able to see the cable converter USB-Serial OR max. Please see the pictures for more details
Thank you
Felix
-
flatten to a string for sending via TCP/IP contains CRLF characters
Hello
I use a function 'flatten in string' to send data via TCP/IP.
To minimize delays, I use CRLF mode so that the receive function returns as soon as it receives a sequence CRLF (stop character).
I noticed that every now and then that part of the data is transmitted as the flattened string itself sometimes (but rarely) contains CRLF characters.
I was wondering if this is a correct behavior, or if I'm missing something. I expected to flatten to string in order to get channels pure ASCII without special characters.Now I must first parse the string replace the CRLF characters of some known series of characters and do the opposite to the front desk and hope that that particular sequence never occurs.
Any comment is appreciated,
Manu
mkdieric wrote:
I expected to flatten to string in order to get channels pure ASCII without special characters.
I don't know why you would think this. A CR or LF is no more extraordinary than any character. In addition, the string you out is not "ASCII" and has never been--check the documentation. The output is entirely dependent on the entry, and it is perfectly possible to get a (hex 13) CR followed by a LF (10 hex) if the entry would produce flattened data which means that.
A better method, in my opinion, is to precede that you send with the number of bytes to wait. Then beside reception read you a fixed number of bytes for the numerical value that indicates the number of bytes comes, and read you this amount. The examples provided with LabVIEW show you this method.
-
How to send data then other more via tcp
Well guys, I am having some problems with it
I have a program to labview that record and show for me in a chart, the voltages and currents
now, I want to do a software... that I can follow the datas of my company...
so I do a server/client via tcp
and I've managed to pass data from one... but I need pass 6 data both
I tried to make a tab control...
But if I put the data received as a tab control
the values do not change x)
I put the server code and client...
so maybe if you guys see
you will understand!
Thank you guys!
-
MODBUS RTU - problem reading Holding - myPCLab Novus records
Hello
I've tried for a few days to read the logs at Novus myPCLab (it uses the Modbus RTU Protocol). I used the DSC module both Modbus Library without success (it seems to connect properly but cannot read).
I need to read the given current.
Does anyone have an idea on what am I hurt?
Here's my vi and modbus address.
Through the DSC
I used the address PLC to 'HR Inicial' and 1 'St number.
Through the library
I used the PLC address in "start address".
You have created a connection that is configured to use a "unit ID" 0. Slave never devices typically use a device number 0 which is considered to be a broadcast address.
Check the address of the slave of your device. So make sure that you use this number.
I guess that you communicate with a device that behaves like a slave. If so, you must create a Modbus master in your code. With the new modbus communication protocol Subvi, you created a slave. A slave cannot talk to another slave.
Similarly, in your second picture when you use the older Modbus Library, you not connected any constant to the top of the SubVI WriteRead that defines the parameters of series of devices such as RTU and address of the slave, so she takes by default to 0. Once again, a broadcast address.
-
MODBUS RTU multiple request &; response (OR VISA)
Hello
I would like to ask how many request and response on MODBUS RTU using VISA? I tried 2 camera digital surveillance, I did a Labview program to connect this device alternately using stacked sequence Structure, but it can communicate with 1 device and the answer, I think that there is an error, the number of bytes does not match what I ask (0 A 04 0000 0002 B 70-0)
It's my screenshot
any suggestion? or maybe use other way to many request and response use NI VISA?
Thank you ~.
It was pretty hard to see this video.
Of course, as part of the 2nd, lower comparison was coming to True, which means the false cases where things was spent could not run. (Seems like the reverse logic to me.)
Well, you check the first two bytes to see if they were not equal to 010 a. They were good because it is the response to the command you send who left 010 a.
In the first picture, it worked because you send the command from 0A 04 and compare to see that's not equal to 0404, which of course is not. What is the point of this? It makes sense to mixed. You want to confirm it is the correct slave address and the correct command (so that they would be equal) to run the code of decoding.
The other comparison is also useless because you try to check if the first two bytes are equal to 0 a, (any image you're in) which they will never because a string of bytes 2 can never be equal to a 1 byte string.
Through execution of high point, you should have been able to understand what was or wasn't running and why.
In addition, you only need a VISA close because you open just a resource of VISA.
Really, you'd be better off using the Modbus Library.
This is a much cleaner version of your code using the Modbus Library.
-
The reading of data acquisition via tcp
Hello
I am building an application that controls an acquisition of data via tcp.
I have a JAVA program that communicate with labview, give a command and data acquisition starts. (So, I read the correct Java data at Labview)
My problem is if I try to read data acquired by data acquisition (continuous sample 1 k samples), I've read strange values.
I transform of double values in the string and send it via tcp.
How can I read it in Java? What type of socket should I use? What is a rate problem?
I also tried to transform small/big-endian byte order, but it does not work.I enclose a sketch of this part of the application.
Please help me, I try for 2 weeks!
Thank you all...I find the solution in the lavag forum.
I post here, if it can help someone.http://lavag.org/topic/16359-sending-LabVIEW-data-via-TCP/page__pid__99983#entry99983
-
Connect two targets in real time via TCP/IP
Hello everyone
I need to connect two targets of RT on TCP/IP protocols
I have two sbRIO Council related to a single host PC through an Ethernet router
and I have two IP address of these two targets, how do I RT - RT ping using the TCP/IP protocol...
Thank you
Syed irfan
irfan789 wrote:
As I am with RT if the IP address of the two targets has a role to play in this communication via TCP/IP
In order to open a TCP connection, you must provide the IP address of the remote computer. It does not matter what operating system, the remote computer is running. If that does not meet your question, so I don't understand what you're asking.
-
Problem of Lookout 6.0.2 modbus rtu?
One of our clients has Lookout 6.0.2 communicates with several Packs of Scada CMI on wireless modems using the Modbus RTU Protocol. All of a sudden Friday night he got comm fail alarm pages on site all but one. The Modbus statistics window revealed that Lookout had stopped voting for all sites, except a single site that remained in communications. The only activity is a single site.
He saw it queries this way for 2 hours, never to regain the normal polling cycle.
I had him quit and relaunch Lookout and mark returned to normal and has been like this since late Friday night.
This system has been in use for several years with very close 100% good communications sice we have deployed so far.
It was obviously a Lookout failure, since the only approach was to quit and relaunch Lookout.
Is there a timer for this kind of mistake?
Is this a failure of the cbx Modbus object? (We use the plain vanilla Modbus driver)
Roger Foote
Foote control systems
-
Hi all
I am trying to write a very simple application that will transfer data via TCP to another computer running a TCP server. (About 3K of data)
Although I followed the code example in the 4.6 Java Development Guide, page 101, on the use of the socket connections, (http://na.blackberry.com/eng/deliverables/3802/development.pdf) I've been running into questions that data transfer crashes after an undetermined number of bytes.
Someone at - it sample code to open a TCP connection and sending the data? This seems to be a very common thing to do, so I don't know what is my problem.
Thank you
DanielI'm not going to answer your first question, I think that we must resolve this problem before you watch something else (and I suspect they are all related).
I would almost guarantee that you run your socket send and receive on the thread of events. The thread of events, that's what treats your interaction Menu, trackball movement etc. If you perform a long running or blocking on this Thread, your device will freeze.
Look at the demo of Socket and move your network of transformation to a Thread separate, as does the sample.
To confirm that the treatment of your socket is executed on the event Thread, you can add this code, run it in the Simulator and watch it in the output window of the debugger and set a breakpoint on the line to System.out.
If {(Application.getApplication (), isEventThread ())}
System.out.println ("running in the thread of events and should not be");
}
-
RS-232 via TCP/IP with LabView
Hello
I have currently a standard equipment is read through a RS232 converter TCP/IP hardware.
On the computer with labview, I use a third-party serial port virtual that data reads the TCP/IP and converts this COM port data pack
I then read the port COM normally with VISA.
I would like to remove the third-party TCP/IP software RS232 and LabView read the TCP/IP port and convert to series.
How could do?
More details about the hardware and the 3rd party software;
thydzik.com/Monitor-cms2000-Inverter-via-tcpip-usr-tcp232-E4-rs232ip-Convertor/
More information on labview here code;
thydzik.com/log-Solar-generated-to-pvoutput-with-LabVIEW/
I don't think it's as complicated as you seem to expect. Try the VISA TCP approach. Create a resource of VISA TCP, in raw mode, as explained in the white paper. Take your existing code, replace the COM resource with the new TCP one, remove the configuration of the port series, and it might work. Make sure to close the resource when you stop the program.
If you want to go with the TCP functions, look at the examples. You open a connection, read and write strings in it, exactly as you would with a serial port and close it when you are finished.
-
I finished by writing a LabVIEW program that I run in S.C. It would be nice to watch some variables from my office here in OH. Although we have several States apart we are on the same network domain. I suspect that there is an easy way to do it. Could someone point me in the right direction for the good vi or information?
There is an example of 'several customers' that comes with LabVIEW. Just look for TCP/IP in the finder of the example. If you set up your code to handle multiple TCP/IP connections, you can have it send data to multiple clients (your computer being one of them)
Maybe you are looking for
-
It is possible to sintonice fm radio on ipod classic 160 gb with an accessory?
It is possible to sintonice fm radio on ipod classic 160 gb with an accessory?
-
Satellite A200 - 14 d high speed USB warning
Hi, guys :) For a few months, I have this warning message...I looked in a lot of forums, but found answers very very different each time :( Hope you can help me. I usually only 1 USB mouse connected to my laptop (with Windows XP Pro SP3).The mouse is
-
Get the current value of the variable when reaching CNVCreateSubscriber
I use CNVCreateSubscriber () to create a subscription read to a network Variable: whenever the value of the variable changes, the DataCallback is called and I'm able to get the new value of the variable. But how to get the value of the variable when
-
Replacement and hard drives in PowerVault 725N
I have an old PowerVault 725N configured with 80 GB of four disks for a huge 320 of storage. I would like to replace these readers with something bigger. Is this possible? Is that simply pulling the old records and inserting new ones? Will I need t
-
Download Outlook Express on my new computer with Windows 7?
Download outlook express on my new computer using windows 7? How? Original title: outlook express & windows 7