News:

  • December 13, 2025, 08:43:47 PM

Login with username, password and session length

Author Topic: Function equvalent to LDF  (Read 22935 times)

milldrone

  • Full Member
  • ***
  • Posts: 48
  • I'm changing my attitude to thumbs up
Function equvalent to LDF
« on: September 08, 2012, 05:49:51 PM »
I'm looking for a equivalent to the load formatted function. I would like to load the status of inputs X2 to X15 into a V memory. I'm presuming the MAPIO is the closest function. Typing in each item is very tedious, perhaps there is another function or an easy way to enter the items.

It does work when I map each input to a single V memory bit.

like:
                             
x2       V5:2
x3       V5:3
x4       V5:4   ect.
 

 
Vaughn

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3601
  • Darth Ladder
Re: Function equvalent to LDF
« Reply #1 on: September 08, 2012, 07:22:06 PM »
I think you're going to need to do a cast, like V0 = X0:W (the cast being the X0:W part)or something like that.  Don't remember off the top of my head what the cast nomenclature is for a 16-bit word.  I believe there's also a bitwise copy function that will copy one memory range to another with no conversion, which should work.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3774
    • Host Engineering
Re: Function equvalent to LDF
« Reply #2 on: September 08, 2012, 07:46:20 PM »
Either of these will work.  The MATH is faster, but not as intuitive, but if you understand bit shifting (>>> unsigned shift right and >> signed shift right), then this is your best bet.

milldrone

  • Full Member
  • ***
  • Posts: 48
  • I'm changing my attitude to thumbs up
Re: Function equvalent to LDF
« Reply #3 on: September 08, 2012, 10:06:39 PM »
Thanks to both of you
Vaughn