Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - timryder

Pages: [1] 2 3 ... 6
1
Support Questions / Re: Monitor change in Rockwell PLC
« on: July 07, 2023, 11:47:42 AM »
Within the 5069 architecture of Rockwell PLC's there does exist a numerical ID that is associated with a "Change" to the plc logic, comments, descriptions really anything other than tag values. You have to use a GSV instruction to poll for this signature and with some logic you can determine if the signatures value has changed. It will at least let you know that the program in any way other than tag values, has been updated. Hopefully this will help you with your quest, as others have stated there is very little you can do to block it but you can at least determine if it has been modified.

(See attached)

2
Support Questions / DataSubscriber2 Array Value issues
« on: July 07, 2023, 11:41:20 AM »
I noticed today that in the DataSubscriber2 object, when returning an Array of "Word" from a Micro800 series plc I get some really weird behaviors depending on the configuration.

In the first sceanario, I created individual entries in the DS2 control for each member of the Array, but interestingly enough, only the first instance of "Data_To_DC_PLC.Analog_Input[0]" fires within my ElseIf structure...

Code: [Select]
If e.Values IsNot Nothing And e.ErrorId = 0 Then
                SSB.Connected = True    'Set the Property to show connected.
                If e.PlcAddress = "Data_To_DC_PLC.DigitalInputs" Then
                    UpdateInputs(e.Values(0))
                ElseIf e.PlcAddress = "Data_From_DC_PLC[0]" Then
                    UpdateOutputs(e.Values(0))
                ElseIf e.PlcAddress = "Data_To_DC_PLC.Analog_Input[0]" Then
                    UpdateAnalog(0, e.Values(0))
                ElseIf e.PlcAddress = "Data_To_DC_PLC.Analog_Input[1]" Then
                    UpdateAnalog(1, e.Values(0))
                ElseIf e.PlcAddress = "Data_To_DC_PLC.Analog_Input[2]" Then
                    UpdateAnalog(2, e.Values(0))
                ElseIf e.PlcAddress = "Data_To_DC_PLC.Analog_Input[3]" Then
                    UpdateAnalog(3, e.Values(0))
                End If
            End If

So yeah strangely enough when I put breakpoints on the remaining ElseIf cases, they never fire.

When I set the Address to "Data_To_DC_PLC.Analog_Input" and then the NumberOfElements to 4, that's when it gets really strange. The ElseIf without the Array pointer 0 does fire, but the values returned have a count of 4 and only the first index actually has a value. The remaining 3 all say "Nothing"... (See attached). 

I have implemented a fix for this in my own code, but i don't quite understand why this is. The Raw Values actually have 2 bytes worth of data for each Tag and using that I am able to convert them into Int16 which gets me my values. But clearly something is broken and it isn't evaluating the raw data for subsequent members of an array properly.

Code: [Select]
If e.Values IsNot Nothing And e.ErrorId = 0 Then
                SSB.Connected = True    'Set the Property to show connected.
                If e.PlcAddress = "Data_To_DC_PLC.DigitalInputs" Then
                    UpdateInputs(e.Values(0))
                ElseIf e.PlcAddress = "Data_From_DC_PLC[0]" Then
                    UpdateOutputs(e.Values(0))
                ElseIf e.PlcAddress = "Data_To_DC_PLC.Analog_Input" Then
                    Dim i As Integer = BitConverter.ToInt16(e.RawData, 6)
                    UpdateAnalog(0, i)
                    i = BitConverter.ToInt16(e.RawData, 8)
                    UpdateAnalog(1, i)
                    i = BitConverter.ToInt16(e.RawData, 10)
                    UpdateAnalog(2, i)
                    i = BitConverter.ToInt16(e.RawData, 12)
                    UpdateAnalog(3, i)
                End If
            End If


3
Open Discussion / Re: Broadcast over internet
« on: September 22, 2022, 03:09:48 PM »
Don't think you're quite giving enough information for you to get some adequite help. Broadcast would assume that something is listening to that broadcast... is there something? Or do you mean you want to host a web interface where you can display these data points. And if you're suggesting this... do you legit mean over the Internet Internet... or just a Intranet like a LAN?

4
Open Discussion / Re: Tag Descriptions
« on: September 22, 2022, 03:07:22 PM »
Yeah kind of. We are using AHMI to display some Fault Pareto's on a screen so the managers and maintenance can determine which issues to work on first. Aka, the squeeky wheel gets the grease first.

So yeah in the logic there are 1000's of tags and we would like to make a program to iterate through a csv file and write values to tag Descriptions if it's possible. I can handle everything, but don't know if the driver even allows it.

@Archie  Do you know?

5
Open Discussion / Tag Descriptions
« on: September 09, 2022, 09:39:33 AM »
This is a strange one... but I have been finding soo much good uses for this fantastic tool that I have a new request I wasn't sure if it could be done. Are you able to utlize the Ethernet/IP Driver for CLX to write Tag Descriptions? Not just the tag values.  Like the comment to the tag as well?

6
Open Discussion / Re: Start up problems VS and AdvancedHMI
« on: September 09, 2022, 09:37:59 AM »
The projects within the solution are mapped or hard coded to their locations on the Hard Drive, if you select the project which isn't working and look at the properties, it will tell you where that path is located on your HD. Often times what you need do is Remove the project from the Solution and re-add the project back into the solution with the new path.

7
Feature Request / Re: I would really like to see MQTT added.
« on: April 18, 2022, 10:37:00 AM »
If possible I second this request.

8
Support Questions / Back to back Writes
« on: December 17, 2021, 12:52:36 PM »
Hey, i have developed a custom app which uses a lot of direct .Write calls to the COM object, which in this case is a CLX driver.  So when I do the .write is there any reason I can't just go back to back with them? Do I have to put a thread sleep in there? Is the .Write function ASync or Sync? Can I get some result verifying that the write was successful?

Here's my code for example where the HMI is controlling the process of the machine through writing of values. It's necessary this way unfortunately based on the machine design.


Code: [Select]
Public Sub RunUserProgram()
        While Globals.CycleStart
            Dim cmdComplete As Boolean = False
            For i = 0 To MainMDIParent.childFormProgramEditor.MarkingOrder.Controls.Count - 1                           'Ensures they're executed in the right order
                For Each c As Control In MainMDIParent.childFormProgramEditor.MarkingOrder.Controls()                   'Loop through every entity
                    Dim tempControl As EntityBaseClass = c
                    If tempControl.entityID = i And tempControl.EntityCheckState = CheckState.Checked Then

                        MainMDIParent.childFormProgramEditor.SetEntityBgColor(c, Color.LimeGreen)

                        If TypeOf c Is MoveEntity Then
ProcessMoveEntity:
                            Dim entity As MoveEntity = c

                            If entity.Axis = "X" Then
                                PLC.Write("cmdAxis", 1)
                            ElseIf entity.Axis = "Z" Then
                                PLC.Write("cmdAxis", 2)
                            ElseIf entity.Axis = "A" Then
                                PLC.Write("cmdAxis", 3)
                            End If

                            If Globals.loggingMode = Globals.LoggingModeSelection.Debug Then MainMDIParent.childFormMain.UpdateMachineActivity("Sending target data: " & entity.TargetPos)
                            PLC.Write("cmdTarget", entity.TargetPos)            'Send the Target Position to the PLC
                            Thread.Sleep(100)

                            Call MainMDIParent.childFormMain.UpdateMachineActivity("Verifying Command Position " & entity.Axis & ": " & entity.TargetPos)

                            'While Not verifyCmdPos(entity.TargetPos) And Not Globals.AbortActive
                            '    System.Threading.Thread.Sleep(100)
                            '    'targetOK = verifyCmdPos(entity.TargetPos)
                            'End While
RetryVerifyTarget:

                            If Not verifyCmdPos(entity.TargetPos) Then
                                Dim resultDlg As Integer = MessageBox.Show("Failed to verify Taget Position data", "Data Transmit Failure", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error)
                                If resultDlg = DialogResult.Retry Then
                                    GoTo RetryVerifyTarget
                                Else
                                    GoTo CancelOperation
                                End If
                            End If

                            Call MainMDIParent.childFormMain.UpdateMachineActivity("Moving " & entity.Axis & " to: " & entity.TargetPos)

                            PLC.Write("cmdMoveCommand", 1)            'Write the command down to the PLC to move
                            Thread.Sleep(100)
                            Call MainMDIParent.childFormMain.UpdateMachineActivity("Waiting for Move Done")

                            While Not verifyMoveDone(entity)  'Loop to check that the move is complete and axis is in position
                                If Globals.AbortActive Then GoTo CancelOperation
                                Thread.Sleep(100)
                            End While

                            Call MainMDIParent.childFormMain.UpdateMachineActivity("Target Move Completed")
                        ElseIf TypeOf c Is TriggerBurnEntity Then
                            Dim entiy As TriggerBurnEntity = c
                            Call MainMDIParent.childFormMain.UpdateMachineActivity("Triggering Laser")
                            PLC.Write("cmdLaserTrigger", 1)
                            Thread.Sleep(100)
                        ElseIf TypeOf c Is LoadProgramEntity Then
                            Dim entity As LoadProgramEntity = c
                            Call MainMDIParent.childFormMain.UpdateMachineActivity("Changing Laser Program to: " & entity.ProgramNumber)
                            PLC.Write("cmdProgramNumber", entity.ProgramNumber)
                            Thread.Sleep(100)
                            PLC.Write("cmdPrgChg", 1)
                            Thread.Sleep(100)
                        ElseIf TypeOf c Is LotNumberEntity Then
                            Dim entity As LotNumberEntity = c
                            Call MainMDIParent.childFormMain.UpdateMachineActivity("Updating Lot Number: " & MainMDIParent.childFormMain.tbLotNumber.Text)
                            PLC.Write("cmdLotNumber", Globals.LotNumber)
                            Thread.Sleep(100)
                            PLC.Write("cmdBlockNumber", entity.BlockNumber)
                            Thread.Sleep(100)
                            PLC.Write("cmdProgramNumber", entity.ProgramNumber)
                            Thread.Sleep(100)
                            PLC.Write("cmdLotChange", 1)
                            Thread.Sleep(100)
                        ElseIf TypeOf c Is ChangeMarkingStateEntity Then
                            Dim entity As ChangeMarkingStateEntity = c
                            entity.parseBlockValues(entity.BlockNumbers, entity.StateCommand)
                            System.Threading.Thread.Sleep(100)
                            Exit Sub                                             'Skip the command complete from PLC since we arent using it.
                        End If
                    End If
                Next
            Next


CancelOperation:   'TODO Insert code to handle an error

        End While
    End Sub

9
Support Questions / Re: AB Micro850 Program Scope tags
« on: December 07, 2021, 03:35:37 PM »
Huge bummer.....

Also, challenge accepted. Lets see if I can crack it.

Thanks for the answer though guys.

10
Support Questions / AB Micro850 Program Scope tags
« on: December 07, 2021, 02:05:13 PM »
Does anyone know the syntax to access a tag which resides in the program scope of a Micro850 program?

I have a program called "Main" and I have created a tag under it's scope called "test" I just want to set that bool using a button. But what is the address for accessing the program scope tags?

"Program:Main.test"

is this it?

11
This can be done a number of ways, firstly the BasicDataLogger2 has a "ComError" event available which can call a method which you could use to write those 0's you're referring to. Not sure exactly what you're writing or how you're holding the data before sending it to the SQL database but that's on you :).  Alternatively, if you use the "DataReturned" or "DataChanged' events, at the very beginning of the event handler method, you could fill all of your temp variables with 0's prior to populating them from the BasicDataLogger2's data, then if the BDL2 is errored the application would write 0's as opposed to the previous data. Again these are all very vague descriptions since I have no idea your application and how it works.

12
Support Questions / Re: AHMI appears to respond slower and slower over time
« on: February 12, 2021, 02:32:34 PM »
Are you using all stock tools of the AHMI or have you written your own custom code which makes use of their libraries?
If you're using just standard controls then I don't really see how this can be an issue... if you have some customizations then you'll need to explain more.

13
Support Questions / Re: AHMI project freezing and low on memory
« on: February 12, 2021, 02:25:06 PM »
An infinitely expanding buffer? Yeah that'd do it. Agree with Archie, would need to see the code of the project to better help.
What's the point of the Buffer, what kind of object is it?

14
Open Discussion / Re: Increasing speed of DataSubscription
« on: November 18, 2020, 11:23:53 AM »
Yeah Agree with Archie, it's a bit more complex than that. 

Although depending on which version of the STM-32 microcontroller you're using, they can support multi-threading. Look for your chip version and the phrase RTOS (real time operating system) and you should find some examples of how to do this. Its not simple, but here is one example. https://www.digikey.com/en/maker/projects/getting-started-with-stm32-introduction-to-freertos/ad275395687e4d85935351e16ec575b1

You can instead create a simulated Multi-threading application where you chunk up your processor into a series of Tasks which have allocated time slices. Again not simple but does offer some level of multi-threading.

15
Support Questions / Re: Variable for PLC IPAddress
« on: July 27, 2020, 11:52:53 AM »
You know... i never have made use of those INI files.... seems like a no brainier!
Thanks Archie.  That'll do perfectly.

Pages: [1] 2 3 ... 6