Further adventures in modbus ethernet land
Some progress in trying to understand why my ethernet modbus VI runs but the executable does not. After generating a simple VI that runs the slave demon.vi with an invoke node, waits for a stop command in a loop and then aborts the VI, I could get this to run as an executable. Great I thought, now to add some ethernet modbus slave functionality to the while loop as per the ethernet modbus slave example vi. At this point I started having problems with the invoke node calling the slave demon.vi in the executable, as posted previously.
So some progress in that I can call and run the slave demon using an executable, but no solution to the overall problem of incorporating the ethernet slave functionality.
Attachments:
SimpleVI #3.vi 33 KB
Simple VI #3.JPG 86 KB
SimpleVI #3.lvproj 13 KB
Think I may have found a solution thanks to a post from a few years back.
I converted my modbus llb into a windows folder and mass compiled. Then I created the project and added this folder. I then moved the slave demon vi and the slave example vi out of the modbus folder so that they appeared separately in the project files window. See jpg attachment.
In the build environment I put the slave example.vi into the "start up VI" folder and the slave demon.vi into the "always include" folder.
One other thing - I kept the path to the slave demon as it was in the slave example. I didn't use a path constant this time (this might have been the problem)!
The application.exe seems to work fine thus far. Fingers crossed.
Attachments:
Working project.JPG 124 KB
Similar Messages
-
Problem Description :
Dear Sir,
We are doing a project where we are using Lookout with
Front end Modicon PLC. The communication is by
Ethernet, using Modbus.
Since the installation is at a distant place, we wanted
to use another PC (running Lookout) to simulate the
PLC. For this, we tried to communicate
a: the server Lookout PC running Modbus Ethernet mode of
Modbus object as Master
b: with another PC (for simulating the PLC) running
Modbus Slave
We did not get any communication. (we have given the
details of what we have done, at the end of this email)
We also tried connecting the above 2 PC's as
a: the server Lookout PC running Modbus Serial mode of
Modbus object as Master
b: with another PC (for simulating the PLC) running
Modbus Slave object
Again we did not get any communication.
If instead of PC (b) we connect the Modbus simulator to
PC (a), there is no problem in communicating
Please let us know how to go about establishing the
communication between 2 PC's using Modbus serial,
and Modbus Ethernet. A detailed step by step procedure
would help us a lot.
Thanking you
Warm Regards
Raja Mahbubani
Procedure of our trial with ethernet.
This is what we have done in detail.
On PC A:
We created an object (Pot) and connected it to
the modbus data member of the modbus object say 40001. In the
properties of the modbus object we selected modbus ethernet mode
of communication and in the IP address field we wrote the IP
address of the machine B to which we are trying to communicate
i.e. 152.63.50.2.
On PC B: we tried the following two methods
Trial 1 : We created a modbus slave object and
inserted an expression for the same data memeber to which the
object was connected hoping to get the value of the pot of machine
A on machine B.
Trial 2 : We created a modbus object on machine B and we wrote
the IP address of machine A and inserted an expression for the
same datamemeber to which the object was connected hoping to get
the value of the pot of machine A on machine B.
NI Software : Lookout
Version : 4.0.1 or 4.5
OS : Windows 98
NI Hardware : N/A
Drivers : N/A
Other Hardware/Instruments : N/A
CPU : Pentium
RAM : 64
Vendor : S-Tech
Customer Information :
Raja Mahbubani
Theta Controls
IN
[email protected]
Ph: (+91) 20 4222556/7The ModbusSlave which comes with Lookout currently supports only Serial communication. So, you cannot use Ethernet between your two PCs. At least not with Modbus Master-Slave setup (if you must speak Ethernet between the two PCs, IPASCII object lets you do that, but then you'll need to implement your own protocol).
Since all you want to do is simulate a Modbus PLC on a PC, you can use the Serial mode of communication for now. And later on just modify the Object in your Server Lookout to use the Ethernet mode.
For setting up a Serial Modbus Slave, use a null-modem cable between the two PCs (lines 2 and 3 are swapped). On your PC 'B,' create the Modbus Slave object with the right COM port for that PC. And on your PC 'A' create the regular Modbus Object as if you w
ere connecting to the Modbus Simulator box. The only difference here is the cable. The simulator box uses a straight-through cable whereas the Slave needs a null-modem cable.
Hope this helps.
Rgds,
Khalid -
How can i write the floats value in Unitronics vision230 plc using modbus Ethernet
How can i write the Float value in unitronics Vision230 PLC usinsg modbus ethernet (MB Ethernet Master Query.vi) I read and write the 32 bit register, for e.g i want to write the 23.45 value on 2nd add. of MF. And MF register is 32 bit register. I read and write the 32 bit register.
Narendra.
Solved!
Go to Solution.Thanks Amit for your solution but i can not use the string to write the value because MB Ethernet master Query.vi only accepet the integer value its not take string values or any other i.e floats values etc.....otherwise i have no problem to write or read the 32 bit register values , only problem is that the MB Ethernet master Query.vi only accept the integer value there4 how can write the float value.
Narendra
Message Edited by Artemistech on 01-30-2009 11:06 PM -
i am working on read data word from Delta Make PLC in labview 2014 using modbus ethernet communication.
is there any help regarding third party ethernet communication with labview.??Are you using one of NI's modbus library ?
New
Old
See also here for a discussion about modbus libraries. -
I need help with Modbus Ethernet communicat​ion
I try to communicate with a Modbus RTU controller with a MOXA Ethernet to RS232 converter. I use DSC module to create a modbus Ethernet driver, and create a list of shared
variables that are bound to individual addresses in the modbus register.
I have tried for a long time to make this communication stable, but I lose communication after a couple of hours..
I read hex values from the controller registers, and they normally is from 100 to 140 depends.. But after a while some of my
registers drop to zero, and others up to 65408 for instance.. and some digital values hang..
When I restart my vi, it works again for some hours..
Maybe it is a communication problem true Ethernet, because I have tested shared variables in other ways, and it works fine..
I want to know if there is any specific rules how to put up a good way to communicate with my modbus driver true Ethernet.. I have enclosed one of the examples that I tried, and I have also tried to read values directly into while loops, but I lose communication after a while
Anybody… please I need help. I would be happy to see a good and stabile way to put up a communication example..
I also tried some of the modbus examples, but I didn't manage it to work.. I use one master controller and one slave, and I use ID 32 for
the master and ID 01 for the slave..
Thanks..
Very best regards from..
Benji..
Attachments:
test37.vi 83 KBHi.. and thank's for your answer..
Yes, I have downloaded and tried the modbus lib before, and it works, but I have to rebuild it to make it work good for my system..
Maybe that is the way to go.. But I also thought that when I have DSC installed, it would be easier to use that one..
In the mean time I've did some test's and, I see that the problem maybe is in my modbus gateway..
Anyhow.. thank's for your answer...
Regards from Benji.. -
Modbus ethernet communications problem
We are having a lot of trouble with modbus ethernet communications. We are using Lookout 6.0.2. Communications is via a Lantronix UDP100 convertor to RS485. The protocol is MODBUS RTU. A number 6-8) instruments are daisy chained on the RS485 (2-wire) line and then connected to the Lantronix. I am using your Ethernet modbus driver.
If all the modbus instruments are connected then the system works fairly well. However if one gets powered off or disconnected we start getting random comm fails from all the other instruments on that RS485 link. This happens even if I stop polling the dead instrument. It only goes away and the network performs perfectly if I close the modbus driver for the dead instrument.
This behavior does not happen if we use RS485 to Lookout instead of the Lantronix+ethernet.
Need some ideas soon.
- VSDoes the convertor you said support Modbus? Because Modbus serial protocol is different from Modbus TCP protocol, if the convertor doesn't support Modbus, I think it won't work.
On the market, you can find Modbus/TCP to Modbus RTU gateway. But I'm not sure if your convertor has the same feature.
Ryan Shi
National Instruments -
Modbus Ethernet U16 vs I16 Data type
Hi,
I'm re-writting a piece of code that communicates Modbus Ethernet to the downstream device. I'm using the Labview Modbus Library VIs.
The machine variables that I am trying to write are I16 (ie. I'm trying to write the value -22) but the Labview MBE library writes the values as U16.
The U16 value that it generates is 65514 (from a I16 input of -22)
anyone have an idea how I should fix this? Would it be worth it to rewrite the Library files to output I16 instead of U16... I'm nervous this might cause other problems?Either typecast it or use the To U16 bullet to convert the number.
Or have you just tried wiring it up to see if it works?
The VISA functions just send it out as bytes in a string. So your device will just interpret the bytes how it sees fit.
Attachments:
Example_VI.png 5 KB -
Modbus ethernet driver not sending complete packet
Hello,
I have a modbus ethernet driver sending out Floating point data (F0002-F0026) once per machine cycle for spc collection. The problem is that the last float32 is getting cut in half and the data is not coming across. To remedy this, I have set up an additional register (F0028).
Attached is a screenshot of my advanced modbus settings and the ini file. Would any of these settings contribute to the problem?
Thanks,
Steven
Attachments:
Modbus Ethernet.zip 119 KBHi Pratik,
Are you using bufmod module for buffering the data? If so, then you must be using SBIOCCHUNK ioctl to increase the streams watermarks? problem with this is that bufmod can only increase the watermarks to 64K, which may not always be sufficient for all the DLPI applications.
There is a way to increase the system-wide streams watermarks using adb if you don't want to write a module to use M_SETOPTS. Please provide your email address if you need more information.
Regards,
Sun/DTS -
Modbus Ethernet Slave coils and discrete inputs
Hi,
I'm having serious problems in the comunication of more than 16 bits for coils or discrete inputs.
In this forum i've read some few post about this matter, tried the possible solution but got nothing working.
Guess that there is some kind of limitation or error in the ModBus modules available at the NI Labview webpages.
The idea is very simple:
I want to be able to sent 32 bits of coils from the ModBus Ethernet Master to the slave and sent 64 bits of discret inputs from the ModBus Ethernet Slave to the Master.
Can someone please give me a push? Im' kind of newbie with the Labview and would apreciate if someone that had this problem resolved could guit me a hint.
My best regards, Jorge
Solved!
Go to Solution.Hi Jorgelopes,
thank's for posting on National Instruments forum.
Can you tell me if you want to communicate with an automate or a computer.
If you do not tried between two computer I suggestion to make the test.
Can you send the VI with which you encounter this trouble?
Best regards,
Flo
Open Diagram First -
Modbus Ethernet Stopped Communicat​ing
Running an application with 30 MODBUS Ethernet RTUs. App ran fine for days, then yesterday just stopped talking to the RTUs. Checked the obvious (network connectivity, went through reboot, made sure windows firewall is off, etc) but no luck. Can ping each RTU from the server, but Lookout 6.1 has comm failure. PC has two NIC cards (One on routable subnet, and second on RTU subnet). Looked at metric to be sure no problems there, but can't figure out the problem. Any help is appreciated
Here is a Modbus master utility. Please use it to test the modbus connection.
Run the ModScan32. Connection->Connect, select Remove TCP/IP Server. Choose the register type, such as holding register. Let's see if the Modscan is able to connect your modbus devices.
Ryan Shi
National Instruments
Attachments:
modscan32.zip 551 KB -
Set Digital Output for Modicon 340 through Modbus Ethernet
Hello,
I used modbus Ethernet example vi and am able to read input coil status of quantity 512
If starting address is changed above 511, VI returns 6002 error.
As per below concept, how can I write to output coil
Output Coils are assigned the block 1-9999
Input Coils are assigned the block 10001-19999
Input Coils are assigned the block 10001-19999
Input Register are assigned the block 30001-39999
Output Register are assigned the block 40001-49999
I also tried sending command directly to TCP IP write like 05 00 AC FF 00 to set a coil. Still its not working.
Can anyone inform how to proceed. Any example or command structure is highly helpful
Thank youI don't see a "jacks" button on my console, therefore I can't reconfigure the jack to digital.
Is this not available on the Go! unit? -
Lookout Modbus Ethernet driver for Do-More PLC?
I see AutomationDirect has now come out with a Do-More PLC CPU that uses DirectLogic 205 hardware. Their documentation states that the new CPU Ethernet port communicates with protocols that include:
Modbus/TCP Client (Master) and
Modbus/TCP Server (Slave)
Would the Lookout Modbus Ethernet driver communicate with this?
Solved!
Go to Solution.Yes, Modbus driver supports ethernet
We us the ECOM-100 and MB-Gateway
Forshock - Consult.Develop.Solve. -
What is minimum poll rate for lookout protocol drivers using modbus ethernet
When configuring the device in lookout protocol drivers as modbus ethernet, what is the fastest update rate that can be used. The default value is 1 second and if I try to enter 0:00:500 the computer beeps and will not accept the value
It's possible to enter poll rates smaller than 1 second. Just don't use a colon but a dot as a decimal seperator for the seconds. That means, don't enter "0:00:500" but e. g. "0:00.5". Entering simply ".5" would do it, too.
Regards,
Jochen Klier
Application Engineering Group Leader
NI Germany -
Send ASCII String as Command to Modbus Ethernet Device
Hello Precious Developers,
How do we send the following string command from a PC to a Modbus Ethernet device at starting address 411000 using LVDSC:
"<ID 0><CLR><WIN 0 0 287 31><POS 0 0><LJ><BL N><CS 2><RED><T>H</T>""$0D""$0A"
(Function code 16 - Write multiple Holding registers)
Any pointers / suggestions / example code shall be deeply appreciated.
Solved!
Go to Solution.hi,
I implemented your solution but when there is an odd number of character, the last character is not included in the u16 array. Is my implemented correct?
Regards,
Cedric
Attachments:
string_transfert_MODBUS.vi 7 KB -
Modify modbus/ethernet port 502 to 5205
it is possible to modify modbus/ethernet default port 502 to 5205 ??
Driver Modbus ethernet Lookout Direct 6.0
Thank you very much
Mauricio MartinezIn LokooutDirect 6,0 not exists the possibility of changing it?
The ADAM-7541 (transforms 422 to ethernet ) works in modbus/ethernet in port 5205, at this moment profit to work with emulating a serial door and modbus/serial, but the idea is that driver Modbus selecting Ethernet , works directly with modbus/ethernet.
Thank you very much
Mauricio
Maybe you are looking for
-
Issue with retrieveing the Manager of a System User in a Custom workflow - CRM 2013
Issues with custom workflow activity in CRM 2013 On-prem I'm trying to pass the Manager of the System here is the code that I'm running, it gets to setting the MANAGER and stops I put the ran the FetchXML seperatly and it does return a value so I kno
-
Get "TV Out" graphics card for PAL monitor?
I'm having problems acheiving an external PAL monitor thru my camera. What if I cut out the camera with a new card for 'TV out', would this make the set-up more robust. Would the 'TV out' merely duplicate the computer monitor display? This is really
-
My phone is saying that it can not be activated
What can I do?
-
Problem with downloading a working trial version of PS CC
How do I download a working trial version of Photoshop CC? I downloaded and installed it once but was unable to open anything to work with.
-
CS3 Can't activate Recorder - additional solution
Hi all, I was having the standard Windows 7 64bit firewire capture problem outlined here: http://forums.adobe.com/thread/869277. However, having followed those steps, I was still getting the "Can't Activate Recorder. Try Resetting Camera." error when