News:

  • September 27, 2026, 09:36:41 AM

Login with username, password and session length

Author Topic: How do I Reset a variable range of user defined bits?  (Read 20742 times)

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
How do I Reset a variable range of user defined bits?
« on: February 08, 2013, 08:13:03 AM »
I am trying to reset a variable range of user defined discrete bits. Its easy to use the MEMCLEAR, but it won't work with discrete; the RSTR won't work with an indirect address. (INIT won't work with indirects either)

How can I accomplish this seemingly simple task?
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
https://premiersi.com

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: How do I Reset a variable range of user defined bits?
« Reply #1 on: February 08, 2013, 08:48:30 AM »
Hmmm...  You'll either have to
1. use FOR/NEXT or
2. use MOVER with a SOURCE block of cleared bits that are as big as your largest range you want to clear
 :o

We need to look at providing a better solution than those in a future version.  :-[

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: How do I Reset a variable range of user defined bits?
« Reply #2 on: February 08, 2013, 09:09:42 AM »
That will work, Thank you.

In the future release if you could allow the MEMCLEAR to include discrete that would be perfect.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
https://premiersi.com

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: How do I Reset a variable range of user defined bits?
« Reply #3 on: February 08, 2013, 09:55:04 AM »
Funny thing is we created MEMCLEAR so that structure types could be cleared in the same way that RSTR does bits. When considering whether MEMCLEAR needed support bits we said, 'nah, they can use RSTR'. Funny, huh?

We'll get it added into 1.1. Working on it now. Any interest in being a DmD 1.1 beta tester?
"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

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: How do I Reset a variable range of user defined bits?
« Reply #4 on: February 08, 2013, 10:27:39 AM »
We'll get it added into 1.1. Working on it now. Any interest in being a DmD 1.1 beta tester?

Sure!

I also have a feature request:
When using the search function, I would like to be able to search for a structure range by name. Many of my arrays are never referenced by their individual index, but rather by the index in either a loop or in a range style instruction, and I have no way to search for one in my program. For example: I have a structure named SKU with a range of 3000. I have no way to search for it in my program because it is not referenced individualy in the program, so searching for SKU0 returns nothing. I want to be able to search for SKU and to be able to see all of the instructions that reference SKU0-2999. (I hope I made sense...)
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
https://premiersi.com

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: How do I Reset a variable range of user defined bits?
« Reply #5 on: February 08, 2013, 10:31:33 AM »
I also have a feature request:
When using the search function, I would like to be able to search for a structure range by name. Many of my arrays are never referenced by their individual index, but rather by the index in either a loop or in a range style instruction, and I have no way to search for one in my program. For example: I have a structure named SKU with a range of 3000. I have no way to search for it in my program because it is not referenced individualy in the program, so searching for SKU0 returns nothing. I want to be able to search for SKU and to be able to see all of the instructions that reference SKU0-2999. (I hope I made sense...)
And SKU[V2].  The hardest part will be the editor.

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: How do I Reset a variable range of user defined bits?
« Reply #6 on: February 08, 2013, 10:35:52 AM »
And SKU[V2].  The hardest part will be the editor.

That's part of the issue, it is referenced my several vmems, and if I don't remember them all I can't find them(hence the need for SEARCH)
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
https://premiersi.com

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: How do I Reset a variable range of user defined bits?
« Reply #7 on: July 17, 2013, 02:59:11 PM »
I also have a feature request:
When using the search function, I would like to be able to search for a structure range by name. Many of my arrays are never referenced by their individual index, but rather by the index in either a loop or in a range style instruction, and I have no way to search for one in my program. For example: I have a structure named SKU with a range of 3000. I have no way to search for it in my program because it is not referenced individualy in the program, so searching for SKU0 returns nothing. I want to be able to search for SKU and to be able to see all of the instructions that reference SKU0-2999.

I have 10 different memory blocks I have to delete in an existing project. None of them are referenced in any way other than pointers (i.e. SKU[v4]), They are all referenced multiple places with multiple pointers. If I merely delete the block from the Memory Configuration, then I can attempt to sort things out via the Output Window... (unless I forget and press F8 anytime during the process and then the Output list is forever gone), otherwise it is a matter of scrolling through page after page of ladder in programs/tasks trying to find every last reference.
Are there any near future plans to implement such a search?
Just a plain text search would be awesome, even if it would only search the program/task that is in focus (like CNTRL+F on a web page).
Thanks.  :)
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
https://premiersi.com

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: How do I Reset a variable range of user defined bits?
« Reply #8 on: July 17, 2013, 03:07:51 PM »
Also...
When I do a search for a Program block by name. The results will show all SG references, as well as SUSPEND references, etc. but it will not show the RUN reference. Could you please add the RUN reference to the search?
Thanks.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
https://premiersi.com

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: How do I Reset a variable range of user defined bits?
« Reply #9 on: July 17, 2013, 06:35:05 PM »
Also...
When I do a search for a Program block by name. The results will show all SG references, as well as SUSPEND references, etc. but it will not show the RUN reference. Could you please add the RUN reference to the search?
Thanks.
That worked for me.  Check that your Where to Search setting is All Control Logic, not one of the other limiting ones.

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: How do I Reset a variable range of user defined bits?
« Reply #10 on: July 18, 2013, 07:46:34 AM »
That worked for me.  Check that your Where to Search setting is All Control Logic, not one of the other limiting ones.

 :-[
My bad, It's working.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
https://premiersi.com

Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: How do I Reset a variable range of user defined bits?
« Reply #11 on: November 23, 2021, 06:45:33 AM »
Funny thing is we created MEMCLEAR so that structure types could be cleared in the same way that RSTR does bits. When considering whether MEMCLEAR needed support bits we said, 'nah, they can use RSTR'. Funny, huh?

I know I'm REALLY digging in the past here, but I did a quick search, and found this.  I noticed the other day that I can't use a RSTR on a user made block of bits does not reset the bits.  Seems inconsistent to me.  COPY 0 to the bit range does work.  Didn't try MEMCLEAR.  FYI.  Do with it what you will.


franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: How do I Reset a variable range of user defined bits?
« Reply #12 on: November 23, 2021, 09:43:27 AM »
I know I'm REALLY digging in the past here, but I did a quick search, and found this.  I noticed the other day that I can't use a RSTR on a user made block of bits does not reset the bits.  Seems inconsistent to me.  COPY 0 to the bit range does work.  Didn't try MEMCLEAR.  FYI.  Do with it what you will.

I could not duplicate it (see attached screen shot).  I created a user block of bits called MyBits.  I an randomly setting bits MyBits32 thru MyBits63 once every second (see rung address 0).  In the next rung (address 9), I RSTR MyBits40 thru MyBits59, and it's working.  When I disable the rung, the bits are randomly ON, when I enable the rung, those bits are always OFF (status is based on value at end of scan, so since RSTR is AFTER the MATH box, they will always be OFF).

Please provide the program you can duplicate this with.  Mine is in an H2-DM1E with 2.8.3 firmware (NOT the latest, but close enough).

Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: How do I Reset a variable range of user defined bits?
« Reply #13 on: November 27, 2021, 01:27:31 AM »
Hmmm, I went back to the project I had the issue in, replaced the COPY 0 instruction with RSTR again, and tested it, and it worked fine.  Not really sure what happened there, but when I was testing the logic initially, it wasn't working.  Too much late night programming I guess.  Sorry for the false alarm.