Project not getting connected
All previous versions of this software are posted here on the sourceforge.net site. Therefore, you could see if the original version worked and test each successive version to see where it stops working. Even the original project here https://sourceforge.net/projects/modrssim/ had the ability to set socket timeouts.
If you look at the "F1" key "Help" menu, you will see a section on "Script Automation". If you download the full source code you can search for files with the extension VBS for other examples.
ModRSsim2 can't run due to missing mfc100.dll
I am closing this because there has been no response from the creator in a while.
Use the link on the main page here: https://sourceforge.net/projects/modrssim2/ It should be the following: http://go.microsoft.com/fwlink/?LinkID=177916&clcid=0x489 It is a requirement to have Visual Studio 2010 redistributable installed to be able to run this program. You may have have to copy the link and paste it into another browser tab that is blank to make it work.
Use the link on the main page here: https://sourceforge.net/projects/modrssim2/ It should be the following: http://go.microsoft.com/fwlink/?LinkID=177916&clcid=0x489 It is a requirement to have Visual Studio 2010 redistributable installed to be able to run this program. You have have to copy the link and paste it into another browser tab that is blank to make it work.
Use the link on the main page here: https://sourceforge.net/projects/modrssim2/ It should be the following: http://go.microsoft.com/fwlink/?LinkID=177916&clcid=0x489 It is a requirement to have Visual Studio 2010 redistributable installed to be able to run this program.
Check prerequisit in Summary tab, software requires Microsoft Visual C++ Redistributable for Visual Studio 2010. Have you tried install this?
Script Examples would be very helpful
ModRSsim2 can't run due to missing mfc100.dll
I forgot to mention that it works with the original software (MOD_RSsim) under the conditions mentioned above.
No connection possible on server
64bit registers support
Sorry, but I am not planning to add support for 64-bit registers since I am now retired. But, the source code is included, you or anyone else is welcome to add features. Thanks. Doug Lyons
Thank you for your request and idea for a "Feature Request". I am no longer using this regularly or doing development on it since I am now retired, but I will consider it for a future revision. I am closing this now, since it is no "Bug". Note that since I have provided the source code, anyone may add features including youself. If I am provided changes for this, I will review them and try and incorporate them into the next revision.
Assign slade ID via the command line
Forked this on Github
Thank you, Pavel for doing this. I see that you have added some interesting options there. I am closing this now because it is not a "Bug", but I have added a comment onto the "Wiki" page noting this.
Home
Endian formats
I am closing this "Bug" because it was more a "Question" that hopefully has been answered now. Please create another "Bug" report if there is anything remaining to be answered in your opinion. Thanks. Doug Lyons
There are some manufacturers of PLC's that say they support the Modbus protocol that use the swapped word arrangement for floats internally. There is no defined standard within the Modbus documents about how a 32-bit IEEE-754 floating point number is stored in a Modbus PLC. So there is no consistency among manufacturers, other than that most that deviate from what Modbus does, do word swaps. This is what the "Clone" represents. The "Clone" selection means that this handles the 32-bit floats like...
There are some manufacturers of PLC's that say they support the Modbus protocol that use the swapped word arrangement for floats internally. There is no defined standard within the Modbus documents about how a 32-bit IEEE-754 floating point number is stored in a Modbus PLC. So there is no consistency among manufacturers, other than that most that deviate from what Modbus does, do word swaps. This is what the "Clone" represents. The "Clone" selection means that this handles the 32-bit floats like...
Coil writes are not working well for some ranges
Reported as working now with new version 8.21.2.9, so closing
I checked everything works! Thank you very much!
Please try the new version 8.21.2.9 that was just uploaded. Thanks.
Home
In the case that you show above, it may help if you choose the option for "Use Long Timeouts". This changes the numbers from 100ms/500msto 250ms/1000ms. The two numbers represent the maximum time between characters and the maximum time before a message times out. These numbers are only approximations. Thanks. Doug Lyons
Thanks for the quick response! Initially, I used v8.21.2.7. But there was another problem: the correct command to write a set of bit registers (the second and subsequent) is perceived as erroneous, while reading is successful
There was a regression for Modbus Function Code 15 (Hex 0x0F) in the most recent revision of this project, so you may be able to use version 8.21.2.7 and have this work. I plan to create a fix and upload it to SourceForge within a week or so. Thanks. Doug Lyons
The program interprets the received bytes as bits
64bit registers support
Assign slade ID via the command line
Mr. Duarte, Would you be willing to share your VBS code here so that it might benefit others? Thanks. Doug Lyons
Mr. Doug, Thank you very much for the feedback. I have explored a little bit more of the software and, following up on your sugestion, I was able to implement the Set/Get float32 in VBS.
Mr. Duarte, If you look at the 2nd row of selections near the top of the display, there is one that shows "Fmt:". You can use the pull-down selection and set this to "float 32". This will allow you some options. Because a 32-bit float takes two 16-bit registers, they can begin on either an even or odd address. Since the system does not know which is intended, the display attempts to show both values. So you have to decide whether to read/write to the even or odd address. I see that you reference...
Hello Mr. Doug, I am new to ModRSim2, and I have been trying to update IEEE32 floats using the scripts, with no luck so far. Using the SetRegisterValue and GetRegisterValue I can only manipulate one register at a time, and the float32 gets truncated. All the VBS solutions I have found for converting IEEE32 to two words or to four bytes, and vice-versa, seem to use VB functions that are not accepted by the script compiler. Do you have any workaround for handling float32 in ModRSim2 ? Thanks in ad...
Hello, Kali. The ModRSSim2 server takes its IP address from the computer that it is running on. Therefore, it is possible by doing something similar to the following. Install a Virtual Machine server such as Virtual Box or VMWare. Now install an operating system in two seperate instances. You can find a free version of ReactOS that is capable of running this at https://sourceforge.net/projects/reactos/files/ReactOS/0.4.15-ReleaseCandidates/. Set these two machines to have dedicated IP addresses that...
Hello, Kali. The ModRSSim2 server takes its IP address from the computer that it is running on. Therefore, it is possible by doing something similar to the following. Install a Virtual Machine server such as Virtual Box or VMWare. Now install an operating system in two seperate instances. You can find a free version of ReactOS that is capable of running this at https://sourceforge.net/projects/reactos/files/ReactOS/0.4.15-ReleaseCandidates/. Set these two machines to have dedicated IP addresses that...
Hi. Is it possible to run 2 instances of ModRSsim2 with to different IP?. I need to simulate 2 diferent IP both with the same ID.
My task is to set the machine's clock to UTC using a PC connected by modbus. Hundreds of these will be deployed across the country and beyond. Requiring manual intervention by the end user is not an option. So, not at all knowing what I'm doing, I've been slogging around the swamp for a while, and I think I stumbled on the answer. I ended up here: https://learn.microsoft.com/en-us/windows/win32/wmisdk/swbemdatetime Based on that, I came up with this, which appears to work: Set dateTime = CreateObject("WbemScripting.SWbemDateTime")...
Don, It seems to me you should be able to just look up this key's value in the machine manually: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\Bias. Then just take this value (300 for Eastern Time) and plug it into the script as shown below. dim d d = DateAdd("n", 300, Now()) SetRegisterValue 3, 1, DatePart("s", d) SetRegisterValue 3, 2, DatePart("n", d) SetRegisterValue 3, 3, DatePart("h", d) SetRegisterValue 3, 4, DatePart("w", d) SetRegisterValue 3, 5, DatePart("d", d)...
Or maybe not. When I try to run this it doesn't update. If I comment out the for loop it updates, but it doesn't have the UTC offset. I'm also not sure I see how to get the bias for the local time zone. dim d dim offset offset = 0 Dim wmi : Set wmi = GetObject("winmgmts:root\cimv2") Set timeZones = wmi.ExecQuery("SELECT Bias, Caption FROM Win32_TimeZone") For Each tz In timeZones tz.Bias = -300 tz.Caption = (UTC-05:00) Eastern Time (US & Canada) Next d = DateAdd("n", offset, Now()) 'd = Now() SetRegisterValue...
Oops! I should have read your post more carefully. The stack overflow link shows how to do it. Thanks!
Hi Doug, My customer is saying they want the time in UTC. I've seen some posts showing how to read the registry time offset, but I can't get them to work. Here's what one says to do: Dim var_offset Dim WshShell set WshShell = WScript.CreateObject("WScript.Shell") var_offset = WshShell.RegRead("HKLM\System\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias") d = DateAdd("n", var_offset, Now()) But as soon as I add the 'set' line it stops working. I guess you aren't running wscript interpreter?...
Hi Doug, Thanks for the fast response. I was going to post a message this morning that I had figured it out, but you beat me to it. I found the help page, and that told me I needed a VB script and some of the syntax I needed. Then googling 'vb script date' gave me the functions I needed. I ended up with this: dim d d = Now() SetRegisterValue 3, 1, DatePart("s", d) SetRegisterValue 3, 2, DatePart("n", d) SetRegisterValue 3, 3, DatePart("h", d) SetRegisterValue 3, 4, DatePart("w", d) SetRegisterValue...
Don, Please see if you don't have "clock.vbs" in your sources download folder. It shows how you can use the "timer" variable that is part of Visual Basic Script to get the time. Since it is small I will include it here: dim x dim n dim hr dim min dim sec n = int(timer/100) x = timer - n*100 h = timer SetRegisterValue 3, 0, n SetRegisterValue 3, 1, x if ((int(x/10)*10 - x) >= -1) then SetRegisterValue 3, 2, x ' Or your code here end if hr = int(timer/60/60) min = int((timer - hr * 3600)/60) sec =...
Don, Please see if you don't have "clock.vbs" in your sources download folder. It shows how you can use the "timer" variable that is part of Visual Basic Script to get the time. Since it is small I will include it here: dim x dim n dim hr dim min dim sec n = int(timer/100) x = timer - n*100 h = timer SetRegisterValue 3, 0, n SetRegisterValue 3, 1, x if ((int(x/10)*10 - x) >= -1) then SetRegisterValue 3, 2, x ' Or your code here end if hr = int(timer/60/60) min = int((timer - hr * 3600)/60) sec =...
Balaji, Are you using "seperate set of registers for each station"? Please review https://sourceforge.net/p/modrssim2/tickets/22/ If this does not help, please provide the version that you using, a screen shot of the main screen, and a debug log for me to review. With this information, I will be better able to help you. Thanks. Doug Lyons
How do you write scripts? I have a customer with a Modbus client with no user I/O and they want to set the real-time clock. They suggested Open ModSim, and I learned enough javascript to write a script that reads the PC clock and writes time into holding registers. But I can't get it to respond to my requests. I downloaded ModRSsim2 and it replies to the request, but I need to get the time values from the PC's RTC into the registers. Thanks in advance.
Coil writes are not working well for some ranges
Home
where is the device address setting?
Closing now.
Patrick, Address 0 is not deactivated, but receives and processes requests. It just is prohibited from sending a response because of its slave status that address 0 is a broadcast address for all listening slaves. If more than one responded, this would be very confusing in general. Thanks. Doug Lyons
Malformed Modbus message for Function Code = x17
Closing this now.
Jonas, I have just uploaded a new version 8.21.2.8 what should have this functionality completely implemented for both Serial (your case) and Ethernet. Enjoy and Thanks for your interest and comments on this project. Doug Lyons
Socket Timeout
Closing this now.
Version 8.21.2.8 was just released and it changed the range for timeouts from 10-1000 to 1-1000. Thanks for your interest in this project. Sorry it took so long to get to this request. Doug Lyons
Hi Doug, While I haven't been using this program for a while now, I will make sure to give it a twirl once an update lands ;-)
Jonas, As I mentioned above, Function Code 23 was not implemented on the Serial side. I plan to post an updated versions of this program within the next month that will implement it in version 8.21.2.8, so maybe you can watch for it. I have just recently found time to address this issue. Pavel, Your fix just removed the error message, but did not account for the needed response. Thanks for forking and working on this. Doug Lyons
Physical connection. Not a bug.
Moving to 'closed' now. Thanks.
Sarge, Thank you very much for your follow-up comment. I find it very informative and hopefully it will help out any others who might come here for this or a similar problem.
Yes. If you select the format (Fmt:) as "float 32" this will show the numbers as floating point values and you can enter them directly here. Because we cannot know whether the two consecutive words start on an even or odd address, all addresses are displayed as if they were the beginning value, so you will have to know to use and look at only the odd or even displayed values. This does not allow for any word or byte swaps, but only uses the standard IEEE-32 bit floating point format as used in the...
Several PLC use address 0 to receive their request. It is not correct to deactivate address 0 by programming. Especially since it is already possible with the bottom bar.
Socket Timeout
I've fixed this here https://github.com/Cavaler/ModRSsim2/releases/tag/v8.22.0.1
There are some manufacturers of PLC's that say they support the Modbus protocol that use the swapped word arrangement for floats internally. There is no defined standard within the Modbus documents about how a 32-bit IEEE-754 floating point number is stored in a Modbus PLC. So there is no consistency among manufacturers, other than that most that deviate from what Modbus does, do word swaps. This is what the "Clone" represents. The "Clone" selection means that this handles the 32-bit floats like...
Why is it named 'Clone'?...