News:

  • September 03, 2026, 04:22:49 AM

Login with username, password and session length

Author Topic: Modbus IO Scanner  (Read 15529 times)

ryanastiefes

  • Sr. Member
  • ****
  • Posts: 72
Modbus IO Scanner
« on: March 25, 2024, 03:10:56 PM »
I'm trying to Generate a Profile from Config out of a Modbus IO scanner and include my User Data Types but the check box is greyed out. This is a new computer and software install, is there a setting I need to provide?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6175
  • Yes Pinky, Do-more will control the world!
Re: Modbus IO Scanner
« Reply #1 on: March 27, 2024, 09:42:02 AM »
Sorry for the delay.

The data type is only an option if every field of the profile uses the structure as the source/destination. If a single field is referenced to anything else it is disqualified.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ryanastiefes

  • Sr. Member
  • ****
  • Posts: 72
Re: Modbus IO Scanner
« Reply #2 on: April 10, 2024, 03:49:04 PM »
Got it, thank you BobO
On another note I'm trying to use MAXR with a UDT and I am getting an error:
P2 Expression Parameter must be a numberic block element reference around "GT0.VirtualPosition" at character position 6
What am I doing wrong here?
I have attached some screen shots to show what I'm doing.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6175
  • Yes Pinky, Do-more will control the world!
Re: Modbus IO Scanner
« Reply #3 on: April 10, 2024, 03:55:34 PM »
Got it, thank you BobO
On another note I'm trying to use MAXR with a UDT and I am getting an error:
P2 Expression Parameter must be a numberic block element reference around "GT0.VirtualPosition" at character position 6
What am I doing wrong here?
I have attached some screen shots to show what I'm doing.

The ranged instructions only work with simple type ranges like R0-R10, not UDT0.Field-UDT10.Field. Haven't thought about what it would take to extend it, but it might be doable.

You'll probably need to implement it as a loop for now.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ryanastiefes

  • Sr. Member
  • ****
  • Posts: 72
Re: Modbus IO Scanner
« Reply #4 on: April 10, 2024, 04:04:44 PM »
10-4, thanks BobO

ryanastiefes

  • Sr. Member
  • ****
  • Posts: 72
Re: Modbus IO Scanner
« Reply #5 on: April 11, 2024, 03:45:10 PM »
Sorry for all the questions. Using UDTs is a great way to reduce programming time when indentical items are automated. That being said it's suprising to find out that UDTs cannot be used in certain MATH blocks or even a copy function when Destination is more than one. Is there any possiblity that these issues could be mitigated in the next couple of releases, I really think it would make using UDTs so much more efficient.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6175
  • Yes Pinky, Do-more will control the world!
Re: Modbus IO Scanner
« Reply #6 on: April 11, 2024, 03:59:26 PM »
Sorry for all the questions. Using UDTs is a great way to reduce programming time when indentical items are automated. That being said it's suprising to find out that UDTs cannot be used in certain MATH blocks or even a copy function when Destination is more than one. Is there any possiblity that these issues could be mitigated in the next couple of releases, I really think it would make using UDTs so much more efficient.

V0 to V9 is iterating linear memory. That's what the xxxR math functions were designed to do. T0.Acc to T9.Acc is skipping every other DWORD. The skip for UDT0.Field to UDT9.Field is user defined and could be could be up to 252 bytes. Which assumes that's what you meant to do to start with. You may have meant UDT0.Field0 to UDT0.Field9. But regardless, those instructions weren't designed for that, although the last example would actually work if we permitted it.

I'm not saying we can't do it, just that I'm not sure what it will take. At the very least it will require some magic math to figure out what the skip size is. At the worst it would require a complete new set of ranged MATH instructions with additional hidden parameters to manage the skip. I doubt it is trivial in either case, but it might not be terrible. Won't know until it's reviewed. Right now we are eyeballs deep in EIP scanner.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: Modbus IO Scanner
« Reply #7 on: April 11, 2024, 04:13:37 PM »
Doing FOR/NEXT with a block of UDTs is extremely powerful.  This is how you would do it in C or C++ or most other programming languages (I think C++20 just added the concept of ranges).  Speed is critical - MAXR is optimized to do a max across a range of contiguous numerics and bits.

Eventually we want to support the concept of TABLEs where some of these "statistical" functions will be optimized.  MATH MAXR is not optimized for that.  This may be what you may actually need?

ryanastiefes

  • Sr. Member
  • ****
  • Posts: 72
Re: Modbus IO Scanner
« Reply #8 on: April 11, 2024, 05:02:32 PM »
Yeah I'll try the FOR/NEXT for the copy. Thank you

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6175
  • Yes Pinky, Do-more will control the world!
Re: Modbus IO Scanner
« Reply #9 on: April 11, 2024, 07:38:03 PM »
Yeah I'll try the FOR/NEXT for the copy. Thank you

BTW, I dug into the code and think it is not too bad to implement it the way you'd like it to work. Barring a complication I'm not seeing yet, it should be in the upcoming 2.10.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ryanastiefes

  • Sr. Member
  • ****
  • Posts: 72
Re: Modbus IO Scanner
« Reply #10 on: April 25, 2024, 01:13:52 PM »
Good to hear!