Possible ModMultiSim/ModSlaveSim enhancements ============================================= From programming simulation examples (July 2011) ------------------------------------------------ Merge boolean and arithmetic expressions in the language, so that one can use statements like: if $32 then 5 else 8 $6 > $10 This would be like C's handling of truth values: boolean expressions have a value of 0 or 1; in conditionals, 0 is false and anything else is true. Add a limit function that constrains the value of an expression to be within a specified range. E.g.: limit (0, 1000, $24 * 200) would be equivalent to: if $24 * 200 < 0 then 0 else if $24 * 200 > 1000 then 1000 else $24 * 200 but avoids repeating the expression "$24 * 200". (I actually needed this for a much bigger expression.) An alternative (more general) language feature would be the use of temporary variables: #result = $24 * 200; if #result < 0 then 0 else if #result > 1000 then 1000 else #result I also needed a variation on the "limit" example: if $24 * 200 >= 0 && $24 * 200 <= 1000 then $24 * 200 i.e. leave the register value unchanged if the new value is out of range. There are probably a lot more examples like these, so the "temporary variable" language feature is probably the way to go. Conditional expressions would be useful to avoid repeated expressions, e.g: $$ + (if $3 > $4 then 25 else $200) - $16 * ($5 - $8) instead of: if $3 > $4 then $$ + 25 - $16 * ($5 - $8) else $$ + $200 - $16 * ($5 - $8) Temporary variables would probably do instead. It would make statements more readable/writable if one could use names for registers instead of numbers (e.g. $tempA instead of $285). The names would obviously have to be alphanumeric to fit in with the language syntax, so the existing register "names" couldn't be used (these could be called "descriptions" instead). It would be more friendly to allow environment property names to be alphanumeric (i.e. must start with a letter, but may contain digits), and maybe include underscores. Maybe have a description as well as a name. I would prefer not to have the environment properties sorted into lexical order - it would nice to ba able to group related properties together. Notes from using ModMultiSim for Camcom testing (Mar 2011) ---------------------------------------------------------- After using "Open Settings", it would be helpful to have the "Save Settings" dialog default to the same directory & filename. Editing of register values. If the radix is set to binary, and you want to change just one bit, it's a pain to have to enter all 16 bits again. Ability to copy slaves. I wanted several slaves (SCS simulations) that were identical (including statements) except for the slave IDs. One-bit registers. It's a lot simpler to simulate coils & discrete-inputs using these. Ability to pass settings file name on command line. Notes from testing ModMultiSim/ModSlaveSim (Dec 2009) ----------------------------------------------------- Environment->Add Property It's a bit unfriendly to insist on letters only for an environment property. Letters or digits, starting with a letter, would be friendlier. Would be useful if ModMultiSim could read ModSlaveSim configuration files. Can't at the moment because the ModSlaveSim DTD is not in the JAR file. Put message in status bar while opening/saving settings. It would be easier to add multiple register with same type and radix, but different values, names or statements, if the type and radix weren't reset to their defaults after adding a register (although you can, I suppose, add them as a block, all with the same value, and then enter the values/names/statements in the register table). It would also be easier if the address was auto-incremented instead of being cleared. Would be helpful for testing if could pass configuration file on command-line. Would also be helpful for automatic testing to have command-line option to start "serve masters" automatically. From memory - can't find my notes for these ------------------------------------------- Support for 1-bit registers (for coils & discrete inputs): makes address mapping a lot simpler, and reduces bit-manipulation in statements. From "Project Notes" HTML page ------------------------------ Random number generation in statements. Option to display/enter unsigned register values. Scaling/offset of displayed register values. Ability to select which columns of register-table are displayed. Support function 43 sub-function 14 - Read Device Identification. From email enquires ------------------- ModSlaveSim: I was looking for something that was a little more straight-forward in terms of setting up values that could be randomized between specific limits and set to sinewave/sawtooth outputs, etc. ModSlaveSim: I was also wondering if there is a way to edit the registers file outside the program. I'm looking at simulating up to 200 registers. ModSlaveSim: Can the simulator return a specific user defined value on each read (which can happen at any random time to one or more registers). I am writing a special test for my master, so ideally, the slave simulator should be able to detect when register X has been read, then load the next new value for register X; So only after register Y has been read, should it then load the next new value for register Y… ModSlaveSim: I was wondering if there was a way to quick import data into the mbus slave simulator software using spreadsheets etc. Any methods which are faster than entering data one by one would work for us. ModMultiSim: Could you please help me in locating the above software to simulte Modbus on UDP Protocol.