Author Topic: Build problem and basicbutton copy and paste  (Read 2825 times)

antsrealm

  • Newbie
  • *
  • Posts: 13
    • View Profile
Build problem and basicbutton copy and paste
« on: September 05, 2013, 04:26:02 AM »
Archie,

This is probably something I'm doing but here is my problem.

I am using v3.5.8 and noticed a few things out of place. First of all with this version for some reason when I change something in the designer and then run it, it usually wont show up the changes unless I right click on the project in the solution explorer and click 'rebuild'. Then when I run it I see the changes.

The second issue and the more serious one was I created a basic button with the plcaddressclick, plcaddresshighlight and plcaddressselecttextalternate all set to the same address. At first this seemed to work fine with the button changing colour and text as it toggled the boolean tag on and off. However I copied the button and pasted another and changed the tag for the new button and found that when I clicked the new button it toggled the new address but changed the state of the other button that it was copied from despite having different addesses???????

Both buttons are looking at different tags for those three properties yet they seem to be affecting each other. Any ideas why I'm having these issues ?

Thanks.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5267
    • View Profile
    • AdvancedHMI
Re: Build problem and basicbutton copy and paste
« Reply #1 on: September 05, 2013, 06:53:14 AM »
What are the tag types? Are they BOOL, BOOL Array, or bits within DINT.

antsrealm

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Build problem and basicbutton copy and paste
« Reply #2 on: September 05, 2013, 07:19:51 AM »


CONTROL_BITS[1]     >>  For one Button
CONTROL_BITS[2]     >>  For other Button

They are a BOOL array

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5267
    • View Profile
    • AdvancedHMI
Re: Build problem and basicbutton copy and paste
« Reply #3 on: September 05, 2013, 07:57:19 AM »
There are some known issues with BOOL arrays. Are you using version 3.58? There were some fixes to BOOL arrays in version 3.57

antsrealm

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Build problem and basicbutton copy and paste
« Reply #4 on: September 05, 2013, 08:49:59 AM »
Yeah V3.5.8

It did work well with the first button, then after I copied and pasted it and changed the tags on the pasted one it went funny. They both operate the correct tag, they are just changing the highlight property on on the other button despite having the correct tag assignments. It's like something behind the scenes has the property assignments crossed after the copy and paste for the PLC addressing of the buttons.

And why can't I just change something and hit play I seem to have to rebuild the project every time to make the changes stick. I might try re-downloading and starting with a fresh copy.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5267
    • View Profile
    • AdvancedHMI
Re: Build problem and basicbutton copy and paste
« Reply #5 on: September 05, 2013, 09:38:32 AM »
I'm not sure about the build issue. That will occur if you are modifying custom controls or controls in a separate project from the startup project. Go to Tools->Options->Projects and Solutions->Build and Run, then see what the On Run option is set to.

To see if the problem is related to BOOL array, try creating a DINT tag named DINTTag, then use DINTTag.1 and DINTTag.2 in your buttons.

Behind the scenes a BOOL array is really an array of DINT with a façade to the user. The driver has to recognize this and handle it as a special case. I get the feeling the BOOL array was put in RS5000 just to make the transition easier for those used to using bit files in RS500.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5267
    • View Profile
    • AdvancedHMI
Re: Build problem and basicbutton copy and paste
« Reply #6 on: September 05, 2013, 01:05:44 PM »
I have been able to replicate in version 3.58, so I will work it out and try to get a version 3.59 posted this evening.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5267
    • View Profile
    • AdvancedHMI
Re: Build problem and basicbutton copy and paste
« Reply #7 on: September 05, 2013, 02:09:32 PM »
Here is a quick fix to this problem. In EthernetIPForCLXCom.vb, go to about line 774 and edit the code to look like this:
Code: [Select]
            '* Add this read to the list  of grouped reads
            Dim x As New SubscriptionRead
            x.TagName = TagNameNoBit
            '* If it is a BOOL Array round down to the nearest DINT aligned bit
            If SubscriptionList(FirstElement).DataType = &HD3 Then
                Dim DINTNumber As Integer = Math.Floor(SubscriptionList(FirstElement).PLCAddress.ArrayIndex1 / 32)
                x.TagName = TagNameNoBit.Substring(0, TagNameNoBit.LastIndexOf("[") + 1) & DINTNumber * 32 & "]"
            End If

antsrealm

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Build problem and basicbutton copy and paste
« Reply #8 on: September 05, 2013, 06:04:36 PM »
Thanks for the feedback.

I added the code and at first it seemed not to work for the BOOL tag but it is working now, so I'll call that fixed.

I tried it with the DINT tag and that works the opposite way it wont write the toggle to the address but will show the state change by showing the highlight colour and the alternate text when I manually set the bit high in RSlogix 5000.


« Last Edit: September 05, 2013, 06:12:38 PM by antsrealm »

antsrealm

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Build problem and basicbutton copy and paste
« Reply #9 on: September 05, 2013, 06:18:13 PM »
Something else I notice with the buttons is that when the form is first opened and all these bits are already high the buttons are taking a half second to realize they are high and then highlight.



**EDIT** Seems like it some how remembers the last state, so if I stop and start the application if the bit hasn't changed state from when it was last seen it loads in the correct state. If it has changed since the last time it was run then it flicks over. That is ok but it would be nice if I could make the form load with the button already in the correct state and not flick over.
« Last Edit: September 05, 2013, 07:37:13 PM by antsrealm »