News:

  • August 29, 2026, 11:28:48 AM

Login with username, password and session length

Author Topic: Misc. Designer Questions  (Read 48710 times)

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Misc. Designer Questions
« on: February 14, 2013, 08:02:39 AM »
I have a problem copying and pasting a Task block. I right clicked the task in Project Browser and clicked copy Code-Block. When I right click the task folder and click paste, the screen flickers like it did something but nothing changes. If I copy the code-block, then change the name of the existing block (by right clicking and selecting configure code block) before pasting then the screen will flicker but it still won't paste.

BTW. what I'm trying to do is copy a code block that only needs minor changes to perform another similar task, so I could save some programming time. For now I will create a new task and copy and paste the ladder instead.
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: Misc. Designer Questions
« Reply #1 on: February 14, 2013, 08:08:42 AM »
Could the Contact browser (accessed by F4) be made to automatically focus so that I can use the up down arrows to highlight the coil I want and then hit enter without resorting to the mouse every time?
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: 3843
    • Host Engineering
Re: Misc. Designer Questions
« Reply #2 on: February 14, 2013, 08:37:36 AM »
I have a problem copying and pasting a Task block. I right clicked the task in Project Browser and clicked copy Code-Block. When I right click the task folder and click paste, the screen flickers like it did something but nothing changes. If I copy the code-block, then change the name of the existing block (by right clicking and selecting configure code block) before pasting then the screen will flicker but it still won't paste.

BTW. what I'm trying to do is copy a code block that only needs minor changes to perform another similar task, so I could save some programming time. For now I will create a new task and copy and paste the ladder instead.
The current version doesn't handle that very well (intra-project copy/paste), although that has been fixed and will be out in our next release (which has some additional PLC functionality, hence requires testing on both the Designer side AND the CPU/firmware side).

I'm assuming that you are in Edit mode (otherwise, you could not try to "paste" because that command would be disabled or not even show up in the context menu, but you may be using key strokes Ctrl+V and in that case, you may just see a "flicker").

The current version handles intra-project code-block pasting as an APPEND-LOGIC-TO-SAME-CODE-BLOCK operation (yeah, not great, but like I said, it has been addressed and working as you would expect it to in our internal version by creating a "COPY_OF_your_program" and telling you how to rename it).

I was able to duplicate your behavior if I created an empty code block and then tried to copy/paste it.  Since it contained nothing, nothing got appended to the existing code-block, hence just a "flicker".

I also tried it after renaming the original code-block and I got a strange error in my Output Window.  Make sure your Output Window is not floating on some powered-down secondary monitor.  The Output Window should be logging SOMETHING in this situation (mine said "Invalid element" ???).  Yeah, like I said, we've address this and it works great under both INTER and INTRA project code-block pasting, but it's "not soup yet".   :-\

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: Misc. Designer Questions
« Reply #3 on: February 14, 2013, 08:39:27 AM »
Could the Contact browser (accessed by F4) be made to automatically focus so that I can use the up down arrows to highlight the coil I want and then hit enter without resorting to the mouse every time?
Thanks.
Sad, sad, sad.  OF COURSE.  Doh!

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: Misc. Designer Questions
« Reply #4 on: February 14, 2013, 09:04:47 AM »
I have a problem copying and pasting a Task block. I right clicked the task in Project Browser and clicked copy Code-Block. When I right click the task folder and click paste, the screen flickers like it did something but nothing changes. If I copy the code-block, then change the name of the existing block (by right clicking and selecting configure code block) before pasting then the screen will flicker but it still won't paste.

BTW. what I'm trying to do is copy a code block that only needs minor changes to perform another similar task, so I could save some programming time. For now I will create a new task and copy and paste the ladder instead.
The current version doesn't handle that very well (intra-project copy/paste), although that has been fixed and will be out in our next release (which has some additional PLC functionality, hence requires testing on both the Designer side AND the CPU/firmware side).

I'm assuming that you are in Edit mode (otherwise, you could not try to "paste" because that command would be disabled or not even show up in the context menu, but you may be using key strokes Ctrl+V and in that case, you may just see a "flicker").

The current version handles intra-project code-block pasting as an APPEND-LOGIC-TO-SAME-CODE-BLOCK operation (yeah, not great, but like I said, it has been addressed and working as you would expect it to in our internal version by creating a "COPY_OF_your_program" and telling you how to rename it).

I was able to duplicate your behavior if I created an empty code block and then tried to copy/paste it.  Since it contained nothing, nothing got appended to the existing code-block, hence just a "flicker".

I also tried it after renaming the original code-block and I got a strange error in my Output Window.  Make sure your Output Window is not floating on some powered-down secondary monitor.  The Output Window should be logging SOMETHING in this situation (mine said "Invalid element" ???).  Yeah, like I said, we've address this and it works great under both INTER and INTRA project code-block pasting, but it's "not soup yet".   :-\

Before I saw your response I figured out that it did in fact append code to all the blocks that I had tried my copy/paste on...

At the moment I have an interesting situation: I selected all the code in one of the task blocks, I used the shift+down-arrow and highlighted it all in blue, I then proceeded to CTRL+C to copy and then pasted into my new task. Now when I went back to the previous tab/task where I had copied from, the entire block is still highlighted blue and I can scroll and click anywhere in the window and it stays highlighted...
I don't know if it's my PC or ??


Edit: I saved the project to PLC and then saved to disk, also closed the tab for that task and re-opened it; and it was STILL highlighted. I re-selected the ladder and THEN was able to de-select it...
« Last Edit: February 14, 2013, 09:29:28 AM by plcnut »
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: Misc. Designer Questions
« Reply #5 on: February 14, 2013, 09:12:28 AM »
I got a strange error in my Output Window.  Make sure your Output Window is not floating on some powered-down secondary monitor.  The Output Window should be logging SOMETHING in this situation (mine said "Invalid element" ???).

My Output window stays docked at the bottom so that it will automatically pop up. It didn't log anything except for when I clicked the Program Check button, and it logged warnings for duplicate OUT coils because of the copies...
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: Misc. Designer Questions
« Reply #6 on: February 20, 2013, 07:58:43 AM »
Could you make it so that EXIT could be used to terminate a task in the same way that it terminates a program?
I always have a hard time remembering the instruction to stop a task from running within itself, and the EXIT is also cleaner looking when viewing the ladder to know what is going on.
Maybe this goes deeper than meets the eye, but I wanted to ask about it.
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: Misc. Designer Questions
« Reply #7 on: February 20, 2013, 08:30:42 AM »
MEMCOPY: I am trying to shift all the Data up in a user defined structure, but if I use indirect addressing for the source memory and then I use a the same indirect +1 for the destination; then I am not allowed to use the end of source or the end of destination fields. I would like to be able to enter the last memory location of the structure in the end of destination structure. Can this be (made to be)done?

See screenshot of what I want to do, (I know I can use a math instruction to calculate the numer of source elements but was hoping I could do it in 1 instruction).
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
Another MEMCOPY problem
« Reply #8 on: February 20, 2013, 12:53:17 PM »
I have attached a screenshot. When this rung is called, the LOC MEMCOPY updates perfectly, the SKU MEMCOPY does not. I know it will update part of the range but not all of it...

Results of a test I just did:
The V130 in the screenshot contains 368, and the index value for the SKU and LOC is at 6, but the SKU table(which is a user defined 8 character string structure) only shifted up through index 129. (LOC is a user defined unsigned word structure)
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: Another MEMCOPY problem
« Reply #9 on: February 21, 2013, 05:48:20 AM »
I have attached a screenshot. When this rung is called, the LOC MEMCOPY updates perfectly, the SKU MEMCOPY does not. I know it will update part of the range but not all of it...

Results of a test I just did:
The V130 in the screenshot contains 368, and the index value for the SKU and LOC is at 6, but the SKU table(which is a user defined 8 character string structure) only shifted up through index 129. (LOC is a user defined unsigned word structure)

I was able to make this work this morning by multiplying the index by 3. In other words; When shifting a table of data up by 10 indexes using MEMCOPY: use 10 in Number of Elements for an unsigned word, but to move an 8 character string you have to enter 30 in Number of Elements.

Either I'm not understanding something, or there is something wrong.

Please help
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: 3843
    • Host Engineering
Re: Misc. Designer Questions
« Reply #10 on: February 21, 2013, 11:05:31 AM »
There is an issue with the MEMCOPY instruction when dealing with STRINGs/arrays/variable indexes.  I was able to replicate the behavior in a simple TASK.

Please modify this code if necessary.  It uses V1000 as a FOR loop index and V1001 as a calculated array index.  It basically counts from 1 to V130 (the number of elements to "shift").  It then calculates the "last" index and copies from the "last" to "last+1", moves to the "previous".  I tried it with moving 4 SKU's starting from SKU100, so
SKU100 is unchanged
SKU101 is the OLD SKU100
SKU102 is the OLD SKU101
SKU103 is the OLD SKU102
SKU104 is the OLD SKU103
SKU105 is unchanged

This task uses V1000 as a 1-based loop counter, and V1001 as the calculated "source" array index based off V97, V130, and the current loop counter V1000.

Go into Edit Mode, then do Tools->Insert Instructions from File and make sure you click on the As Code Blocks in the Instruction Import Method section.  Insert the attached file ShiftSKU.txt. This will create a TASK called ShiftSKU, then you just need to run it "on leading edge" and check for the .Done bit.

Attached are a couple screen shots that shows the pre and post Data Views of my dummy SKU data (the first 3 characters are equal to the initial (pre-shift) index, the last 4 characters are random hexadecimal chars).

ShiftSKU.txt - mnemonic import of the ShiftSKU Task
preSHIFT.png - screen shot of data BEFORE executing ShiftSKU task
postSHIFT.png - screen shot of data AFTER executing ShiftSKU task (it appears to work!!)

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6174
  • Yes Pinky, Do-more will control the world!
Re: Another MEMCOPY problem
« Reply #11 on: February 21, 2013, 12:11:19 PM »
Please help

I'm so sorry. ::) Yet another instruction pathway slipped through the cracks...and you found it. It only affects structure copies with a variable count. Arguably pretty obscure, but it should have worked. It does now and will be in 1.1.
"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: Misc. Designer Questions
« Reply #12 on: February 22, 2013, 05:24:30 AM »
This is more of an icing on the cake request: I would like to be able to highlight an instruction by using the arrow keys, and then be able to start editing it without having to click it. I realize that if I start typing, the editor will open, but many times I don't want to edit the first item in the instruction. If I press tab while an instruction is highlighted, I can select different fields, but when I start typing it still edits the first field.

Could you make it so that the field that is highlighted by pressing tab will be the field that is edited when I start typing?

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: 3843
    • Host Engineering
Re: Misc. Designer Questions
« Reply #13 on: February 22, 2013, 08:48:27 AM »
This is more of an icing on the cake request: I would like to be able to highlight an instruction by using the arrow keys, and then be able to start editing it without having to click it. I realize that if I start typing, the editor will open, but many times I don't want to edit the first item in the instruction. If I press tab while an instruction is highlighted, I can select different fields, but when I start typing it still edits the first field.

Could you make it so that the field that is highlighted by pressing tab will be the field that is edited when I start typing?
It's not obvious, but use the space bar.

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: Misc. Designer Questions
« Reply #14 on: February 22, 2013, 09:12:40 AM »
It's not obvious, but use the space bar.

Cool! Thank you. I figured it was in there somewhere but I hadn't found it...
Circumstances don't determine who we are, they only reveal it.

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