News:

  • August 15, 2026, 02:11:05 AM

Login with username, password and session length

Author Topic: Octal Mapping  (Read 10307 times)

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Octal Mapping
« on: October 07, 2019, 06:12:08 PM »
This is probably an odd question. I'm potentially looking to replace an older Mitsubishi FX3U controller with a BRX. The FX3U uses octal numbering for I/O. Is there any way in the BRX to use octal numbering for the I/O so that it can be directly mapped over? I know I could use nicknames to accomplish mapping but if possible I would like to have a direct map without using nicknames. If using nicknames I would have to use something akin to X002-->_X002 as the nickname cannot be X002.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: Octal Mapping
« Reply #1 on: October 07, 2019, 06:26:02 PM »
This is probably an odd question. I'm potentially looking to replace an older Mitsubishi FX3U controller with a BRX. The FX3U uses octal numbering for I/O. Is there any way in the BRX to use octal numbering for the I/O so that it can be directly mapped over? I know I could use nicknames to accomplish mapping but if possible I would like to have a direct map without using nicknames. If using nicknames I would have to use something akin to X002-->_X002 as the nickname cannot be X002.

We actually designed it to be selectable, but the changing radix caused issues with C-more, so we removed that ability.
"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

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: Octal Mapping
« Reply #2 on: October 07, 2019, 08:40:50 PM »
This is probably an odd question. I'm potentially looking to replace an older Mitsubishi FX3U controller with a BRX. The FX3U uses octal numbering for I/O. Is there any way in the BRX to use octal numbering for the I/O so that it can be directly mapped over? I know I could use nicknames to accomplish mapping but if possible I would like to have a direct map without using nicknames. If using nicknames I would have to use something akin to X002-->_X002 as the nickname cannot be X002.

If the application is small (probably less than 64 in, 64 out), you could just skip the I/O with 8's and 9's in the address.  Or, go Euro, and instead of X&Y in the nicknames use I&Q.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Mike Nash

  • Hero Member
  • *****
  • Posts: 652
Re: Octal Mapping
« Reply #3 on: October 08, 2019, 08:57:50 AM »
You could use DLX and DLY which are octal-ly addressed. Use a COPY at $TopOfScan, e.g., COPY DLX0 X0 16 would copy X0-X15 into DLX0-DLX7, DLX10-DLX17.

$BottomOfScan would have COPY DLY0 Y0 16.

You still have to use DLX instead of X, but no nicknaming required.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: Octal Mapping
« Reply #4 on: October 08, 2019, 09:30:27 AM »
You could use DLX and DLY which are octal-ly addressed. Use a COPY at $TopOfScan, e.g., COPY DLX0 X0 16 would copy X0-X15 into DLX0-DLX7, DLX10-DLX17.

$BottomOfScan would have COPY DLY0 Y0 16.

You still have to use DLX instead of X, but no nicknaming required.

Great work-around - but need to swap the DLX and X in the $tTopOfScan (X is source, DLX is destination).

Note that bit copies are very slow (bit picking, bit masking, etc.).  Numeric copies are fast.  When everything is BYTE-aligned, use casts with MEMCOPY (very fast):
MEMCOPY X0:UB DLX0:UB 2
This will copy 2 BYTEs worth of bits starting at X0 into DLX0, so X0..X15 (decimal) into DLX0..DLX17 (octal)

As long as you don't have any old DirectLOGIC PLCs remotely mastering reading/writing to "X" or "Y" memory to the Do-more as a DL slave, this will definitely work (DLX/DLY emulates that memory region for old DL PLC comm requests).

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: Octal Mapping
« Reply #5 on: October 08, 2019, 09:33:28 AM »
And for simple WORD moves, MATH is fastest by far.
"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

Mike Nash

  • Hero Member
  • *****
  • Posts: 652
Re: Octal Mapping
« Reply #6 on: October 08, 2019, 01:13:15 PM »
Great work-around - but need to swap the DLX and X in the $tTopOfScan (X is source, DLX is destination).

How embarrassing...OK, I'm over it.

So MEMCOPY was what I started to look at, but didn't look long enough. Being able to set the end of source or destination makes it very easy to configure, and bonus, the range of the input and output locations is right there and easy to see.

For MATH, the "visual-ality" is a little less appealing, as well as the limit of 32 bits per MATH instruction (using :SD casting for 32 bits).

And personally, I'm glad you didn't go with octal addressing optionality. It might be "helpful" occasionally, but overall is just cleaner without.

Another option for the OP is to do as Controls Guy suggested and write it using the octal addressing, but then search and replace to move everything where it really is. Search and replace in Do-more is fabulous.