Activity for ModRSsim2

  • Don Burdette Don Burdette posted a comment on a wiki page

    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")...

  • Doug Lyons Doug Lyons posted a comment on a wiki page

    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)...

  • Don Burdette Don Burdette posted a comment on a wiki page

    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...

  • Don Burdette Don Burdette posted a comment on a wiki page

    Oops! I should have read your post more carefully. The stack overflow link shows how to do it. Thanks!

  • Don Burdette Don Burdette posted a comment on a wiki page

    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?...

  • Don Burdette Don Burdette posted a comment on a wiki page

    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...

  • Doug Lyons Doug Lyons modified a comment on a wiki page

    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 =...

  • Doug Lyons Doug Lyons posted a comment on a wiki page

    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 =...

  • Doug Lyons Doug Lyons posted a comment on ticket #29

    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

  • Don Burdette Don Burdette posted a comment on a wiki page

    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.

  • Balaji Balaji created ticket #29

    Coil writes are not working well for some ranges

  • ModRSsim2 ModRSsim2 updated /V8.21/README.txt

  • ModRSsim2 ModRSsim2 updated /README.txt

  • ModRSsim2 ModRSsim2 updated /V8.21/README.txt

  • ModRSsim2 ModRSsim2 updated /README.txt

  • Doug Lyons Doug Lyons modified a wiki page

    Home

  • Doug Lyons Doug Lyons modified ticket #25

    where is the device address setting?

  • Doug Lyons Doug Lyons posted a comment on ticket #25

    Closing now.

  • Doug Lyons Doug Lyons posted a comment on ticket #25

    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

  • Doug Lyons Doug Lyons modified ticket #24

    Malformed Modbus message for Function Code = x17

  • Doug Lyons Doug Lyons posted a comment on ticket #24

    Closing this now.

  • Doug Lyons Doug Lyons posted a comment on ticket #24

    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

  • Doug Lyons Doug Lyons modified ticket #28

    Socket Timeout

  • Doug Lyons Doug Lyons posted a comment on ticket #28

    Closing this now.

  • Doug Lyons Doug Lyons posted a comment on ticket #28

    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

  • ModRSsim2 ModRSsim2 updated /V8.21/README.txt

  • ModRSsim2 ModRSsim2 updated /V8.21/ModRSsim2_8.21.2.8.exe

  • ModRSsim2 ModRSsim2 released /V8.21/ModRSsim2_Setup.msi

  • ModRSsim2 ModRSsim2 updated /ModRSsim2.exe

  • ModRSsim2 ModRSsim2 released /V8.21/ModRSsim_Setup.msi

  • ModRSsim2 ModRSsim2 updated /ModRSsim2.exe

  • ModRSsim2 ModRSsim2 updated /README.txt

  • ModRSsim2 ModRSsim2 released /ModRSsim2_8.21.2.8.exe

  • ModRSsim2 ModRSsim2 updated /V8.21/ModRSsim2_8.21.2.8.exe

  • ModRSsim2 ModRSsim2 updated /V8.21/README.txt

  • ModRSsim2 ModRSsim2 released /V8.21/ModRSsim2_8.21.2.8.exe

  • ModRSsim2 ModRSsim2 released /V8.21/ModRSsim2Source8.2.21.8.zip

  • Jonas A. L. Andersen Jonas A. L. Andersen posted a comment on ticket #24

    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 ;-)

  • Doug Lyons Doug Lyons posted a comment on ticket #24

    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

  • Doug Lyons Doug Lyons modified ticket #23

    Physical connection. Not a bug.

  • Doug Lyons Doug Lyons posted a comment on ticket #23

    Moving to 'closed' now. Thanks.

  • Doug Lyons Doug Lyons posted a comment on ticket #23

    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.

  • Doug Lyons Doug Lyons posted a comment on a wiki page

    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...

  • Patrick Bouchard Patrick Bouchard posted a comment on ticket #25

    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.

  • Rolf Nordholm Rolf Nordholm created ticket #28

    Socket Timeout

  • Pavel Kostromitinov Pavel Kostromitinov posted a comment on ticket #24

    I've fixed this here https://github.com/Cavaler/ModRSsim2/releases/tag/v8.22.0.1

  • Doug Lyons Doug Lyons posted a comment on ticket #26

    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...

  • Pavel Kostromitinov Pavel Kostromitinov posted a comment on ticket #26

    Why is it named 'Clone'?...

  • Pavel Kostromitinov Pavel Kostromitinov created ticket #27

    Forked this on Github

  • Doug Lyons Doug Lyons posted a comment on ticket #26

    I suggest that you try using the F1 key and looking at the HTML help file. To answer your question, on the "Registers" display near the top right there is a "Clone" checkbox that reverses the byte order for floats and doubles. Thanks.

  • Doug Lyons Doug Lyons posted a comment on ticket #25

    This program responds to any Device ID from 1 through 255. Device ID zero (0) is a broadcast address and any requests to this address create no responses. This is the reason that there is no input needed for this parameter. The bottom of the display shows which device is asking for data and you can go to the "Comms" display to see the Device ID. I normally consider this a feature, rather than a bug. Thanks.

  • Doug Lyons Doug Lyons posted a comment on ticket #24

    Sorry for the delay. I have had health problems lately and am moving slowly these days. From looking at what you attached, it looks like you may be testing using the "serial" protocol. If so, then I have not addressed this at all. I have been testing and using only the TCP/IP protocol. FC23 was the last Function Code that I added and did not address the "serial" side. I retired about 2 years ago and no longer use this much, so there is not much chance I will fix this. Thanks for reporting and if...

  • Chuck Chuck created ticket #26

    Endian formats

  • Chuck Chuck posted a comment on a wiki page

    How are two register 32bit floats simulated? Do I have to manually figure out the bytes and put in two consecutive registers or is there a way to enter the single value and the simulator can populate both registers?

  • Chuck Chuck posted a comment on ticket #24

    FYI- I think no one is listening...

  • Chuck Chuck posted a comment on ticket #25

    I figured it out, thanks for the reply

  • Chuck Chuck created ticket #25

    where is the device address setting?

  • Sarge (sergeantkolja) Sarge (sergeantkolja) modified a comment on ticket #23

    Ha Doug, believe it or not ... or read the official Doc from modbus.org: https://modbus.org/docs/Modbus_over_serial_line_V1_02.pdf ;-) The Schneider picture posted by Chris is "3.5.2 Connectors pin-out for optional 4W-MODBUS", Page 30. This is quite uncommon, but the Pins4/5+8 is also used for the very common "3.5.1 Connectors pin-out for 2W-MODBUS" Page 29. Edit: Okay, I now see your sentence "I do not believe that there is any standard for an RJ45 Modbus connection" could also be read like "Surely...

  • Sarge (sergeantkolja) Sarge (sergeantkolja) posted a comment on ticket #23

    Ha Doug, believe it or not ... or read the official Doc from modbus.org: https://modbus.org/docs/Modbus_over_serial_line_V1_02.pdf ;-) The Schneider picture posted by Chris is "3.5.2 Connectors pin-out for optional 4W-MODBUS", Page 30. This is quite uncommon, but the Pins4/5+8 is also used for the very common "3.5.1 Connectors pin-out for 2W-MODBUS" Page 29. HTH, Sarge

  • Jonas A. L. Andersen Jonas A. L. Andersen created ticket #24

    Malformed Modbus message for Function Code = x17

  • Doug Lyons Doug Lyons modified ticket #22

    Multiple ID,

  • Doug Lyons Doug Lyons posted a comment on ticket #22

    Closing now. This is actually a feature request and not a bug. Thanks.

  • Doug Lyons Doug Lyons posted a comment on ticket #23

    Chris, I do not believe that there is any standard for an RJ45 Modbus connection. I have used many RJ45 connectors in the past and I have always had to refer to the equipment vendor's documentation and mostly use conversion from their standard to RS-232 standard 9-pin D-shell connectors. I have used RS-485 signal levels in the past as well, but only with full documentation from the vendor of the converters or devices. Good Luck! Doug Lyons

  • Chris Smyth Chris Smyth created ticket #23

    Physical connection. Not a bug.

  • fleaplc fleaplc posted a comment on ticket #22

    Hi Doug, I realized to 5th station "illegal data address" was due to 13000 I set... Thanks for confirm. I get a workaround by voiding to use ID 5,11,16.... If in the future you'll get a fix, please inform me Do you have a newsletter or similar I can register into? Fabrizio On Thu, Dec 2, 2021 at 6:18 PM Doug Lyons douglyons@users.sourceforge.net wrote: OK. I believe that I see what is happening here. We only have a maximum of 65536 registers that we can use. If you are assigning 13000 registers per...

  • Doug Lyons Doug Lyons posted a comment on ticket #22

    OK. I believe that I see what is happening here. We only have a maximum of 65536 registers that we can use. If you are assigning 13000 registers per station then we can calculate the maximum stations that you can use as the integer of 65536 / 13000 which is 5. So you can only have 5 stations and so you get the error on station #6. There is a wrap-around effect probably that allows you to use numbers higher than this, that probably should be trapped and reported as an error. On the next revision of...

  • Doug Lyons Doug Lyons posted a comment on ticket #22

    You should use the 'F1' key when ModRSsim2 is the active window to see the help file and search for "Log" to answer your questions. I have attached a picture here that shows what it says. The file will be named "DEBUG.TXT" and will be in the same directory where ModRSsim2 resides. Thanks.

  • fleaplc fleaplc posted a comment on ticket #22

    I enabled logging but..where can I get log files? On Thu, Dec 2, 2021 at 4:13 AM Doug Lyons douglyons@users.sourceforge.net wrote: Also, please turn on logging and capture some example communications for me and attached it here. Thanks. [tickets:#22] https://sourceforge.net/p/modrssim2/tickets/22/ Multiple ID, * Status: open Milestone: 1.0 Created: Wed Dec 01, 2021 04:23 PM UTC by fleaplc Last Updated: Thu Dec 02, 2021 03:09 AM UTC Owner: nobody Attachments: ModRSsim2.mp4 https://sourceforge.net/p/modrssim2/tickets/22/attachment/ModRSsim2.mp4...

  • fleaplc fleaplc posted a comment on ticket #22

    you're right, I'm using "use a separate setof registers for each station" : I need it to emulate multiple node ID on same IP address Slave [image: tvnviewer_lXSWqmJGZt.png] On Thu, Dec 2, 2021 at 4:09 AM Doug Lyons douglyons@users.sourceforge.net wrote: Please send me a screen capture of your "Advanced Emulation Settings" page. It can be viewed by clicking on the next-to-the-last button at the top right of the ModRSsim2 screen. I suspect that you may be using the "Use a separate set of registers...

  • Doug Lyons Doug Lyons posted a comment on ticket #22

    Also, please turn on logging and capture some example communications for me and attached it here. Thanks.

  • Doug Lyons Doug Lyons posted a comment on ticket #22

    Please send me a screen capture of your "Advanced Emulation Settings" page. It can be viewed by clicking on the next-to-the-last button at the top right of the ModRSsim2 screen. I suspect that you may be using the "Use a separate set of registers for each station. Thanks.

  • fleaplc fleaplc created ticket #22

    Multiple ID,

  • Doug Lyons Doug Lyons posted a comment on ticket #20

    One of the options is "Units are all off at startup", so if you check this option, you will have to manually say what you DO want. Maybe that is a help.

  • david collier david collier posted a comment on ticket #18

    Oh, excellent. Will peruse - TVM As usual I have plenty of time to do the job badly, none available to do it properly.

  • david collier david collier posted a comment on ticket #19

    Yup, but my bomb-aiming skills are a bit rusty, so I need all the help I can get.

  • david collier david collier posted a comment on ticket #20

    I just feel that if the s/w being tested is meant to read from slave 2 - but by mistake is reading from 4 - you don' make the world better by replying on 4 :-) So I'd force the user to say where they DO want it to reply, rather than reply to all slave addresses. I see you have a broadcast setting, which would allow that if desired.

  • david collier david collier posted a comment on ticket #21

    Thank you - I had missed the 'at startup' button - that fixes my nervousness, though yes a .bak or a manual archive would be a good thing too. Just to be a devil's advocate - why would you NOT want to restore the last settings at start-up? I believe that people who write stuff have great difficulty un-knowing what they know, and there's nothing like a newbie to ask the obvious, or show you what the man in the street doesn't have at their fingertips. Also on my own stuff I greatly appreciate having...

  • Doug Lyons Doug Lyons modified ticket #21

    over-write register config seems to be very easy?

  • Doug Lyons Doug Lyons posted a comment on ticket #21

    The registers are saved in the file MODDATA.DAT in the same directory as the program. So it may be a good idea to back up this file if it contains lots of changes. You can use a CSV import to set the registers and save this which gives you lots of options for revisions. I will consider adding a confirmation message box to the first two button options in my next program revision. There is a "Load register values on startup" option box when you use the fourth button as shown on the attached screen...

  • Doug Lyons Doug Lyons modified ticket #20

    save 'station enabling'

  • Doug Lyons Doug Lyons posted a comment on ticket #20

    Personally, I never change the stations enabled. But I appreciate your suggestion and I will consider including saving the stations enabled on my next revision.

  • Doug Lyons Doug Lyons modified ticket #19

    Suggestion.

  • Doug Lyons Doug Lyons posted a comment on ticket #19

    I will consider your suggestion for an improvement in my next revision. But for now, once you do double-click, it is very easy to tell where you are as you can see on the attached screen shot. Then you can "Cancel" if you have the wrong address.

  • Doug Lyons Doug Lyons modified a comment on ticket #18

    Please review the "Help" text available by using the F1 key. Attached is an example of setting the stations to all off at startup for both serial and Ethernet options. Also, it shows how to set the registers to automatically load on startup.

  • Doug Lyons Doug Lyons modified ticket #18

    'stations' handling could be better.

  • Doug Lyons Doug Lyons posted a comment on ticket #18

    Regarding a seperate set of registers per station, this shows how to use the Advanced setting to select this and there is a good explanation in the Help available from the F1 key.

  • Doug Lyons Doug Lyons posted a comment on ticket #18

    Please review the "Help" text available by using the F1 key. Attached is an example of setting the stations to all off at startup for both serial and Ethernet options.

  • Doug Lyons Doug Lyons modified ticket #17

    Any change of an easy-to-install option?

  • Doug Lyons Doug Lyons posted a comment on ticket #17

    I am glad that you found it. I have provided a compiled EXE that only needs the Visual Studio 2010 redistributable to be installed. Hopefully, you have figured this out now.

  • david collier david collier created ticket #21

    over-write register config seems to be very easy?

  • david collier david collier created ticket #20

    save 'station enabling'

  • david collier david collier created ticket #19

    Suggestion.

  • david collier david collier created ticket #18

    'stations' handling could be better.

  • david collier david collier posted a comment on ticket #17

    Sorry - have now located it elsewhere.

  • david collier david collier created ticket #17

    Any change of an easy-to-install option?

  • Doug Lyons Doug Lyons modified ticket #16

    No serial config window

  • Doug Lyons Doug Lyons posted a comment on ticket #16

    Closed, since the user answered the question.

  • Doug Lyons Doug Lyons posted a comment on ticket #16

    It is short for "protocol" which indicates whether you want to use serial, ethernet, A-B, or Joy.

  • Chuck Chuck posted a comment on ticket #16

    Never mind I didn't know what prot: was for

  • Chuck Chuck created ticket #16

    No serial config window

1 >