Jump to content

A_Mia

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by A_Mia

  1. I've seen a couple of examples explaining using the .net library to read/write multiple MI's/MB's during a single call

    is it possible to read discrete I/O, Counters, Timers as well as MI/MB/DW/MF/ and SB in one call to the PLC using the .net library?

    Could you provide an example of the function, and then is there detail of the array structure that's generated on the PC side.

    Thanks

    -a

  2. Good afternoon,

    Is it possble to upload a PLC program from a connected PC programmicly?

     

    I've using the Vision 230 in a peice of equipment with 100+ installations around the world, recently we added several features that we need to distrubute to all the PLC's

    From a hardware standpoint, we have a supervisory computer connected to #1 RS232 port.

    We distrubute the PC Superviory software via windows click-once,

     

    I'd like to build a batch file that would run post appilcation installation to update the PLC.

     

    1) has anyone every done a project that the PLC code is distrubuted with a Visual Studio based Application?

    2) any example code available illistrating this process?

     

    Thanks in advance.

     

    Aaron

  3. How would I retrieve the hardware serial number from the V230 throught the .net interface?

     

    Currently I'm following the documented example of

     

              plc = PLCFactory.GetPLC(serial, 0)

                Dim version As PlcVersion = plc.Version
      
                System.Diagnostics.Debug.Print(version.OSVersion)
                System.Diagnostics.Debug.Print(version.HWVersion)
                System.Diagnostics.Debug.Print(version.OPLCModel)
                System.Diagnostics.Debug.Print(version.Boot)

                plc.RTC = DateTime.Now ' write current time and date to the PLC
     

     

    Thanks

    Aaron

  4. All,

    I need to write to a timer preset and am getting an 'object' error using the .net driver.

    I'm sort of between a rock and a hard place...

    THanks in advance.

    Below is the 'function' that attempts to write -

    Public Function Write_TimerPreset(ByVal tmrIndex As Int16, ByVal TmrValue As integer) As Boolean

    Dim values As Object() = New Object(2) {}

    Try

    values(0) = DirectCast(TmrValue, Object)

    Catch

    System.Windows.Forms.

    MessageBox.Show("One of more of the values are not valid")

    Return False

    Exit Function

    End Try

    Dim wo As WriteOperands = New WriteOperands()

    With wo

    .NumberOfOperands = 1

    .OperandType =

    OperandTypes.TimerPreset

    .StartAddress = tmrIndex

    .Values = values

    .TimerValueFormat = TimerValueFormat.SecondsFormat

    End With

    Dim rw(0) As ReadWriteRequest

    rw(0) = wo

    Try

    plc.ReadWrite(rw)

    Catch

    Dim ErrorMessage As String = "Could not communicate with the PLC" & vbCrLf & "Error # " & Str(Err.Number) & " was generated by " _

    & Err.Source & vbCrLf & Err.Description

    'Display the message as a critical message.

    MsgBox(ErrorMessage,

    MsgBoxStyle.Critical, "PLC Connection Error")

    CaptureErr(EquipmentPK,

    "Unitronics Class", "Write_TimerPreset", Str(Err.Number), Err.Source, Err.Description, Now(), EmployeePK, 0)

    Return False

    End Try

    Return True

    End Function

    post-8786-0-92991000-1362343003_thumb.jpg

  5. Thank you for the reply.

    The application is a winforms proejct written in VB on the .net 4 Framework,

    using the .net version of the untronics Driver

    The reason this is an issue is I need to monitor PLC inputs such as an E-Stop for example, by the PC interface every .5 sec.

    This continual monitor loop is causing a massive impact on the UI performance as you can well imagine.

    First thought is to create a read only dataset or datatable for each PLC datatype, for example (ReadInputs, ReadOutputs, ReadMI, ReadMB, etc.) on a background worker thread that's dedicated to monitoring the PLC and exectue a update every .5 sec.

    Using the rowchanged event on the main IU thread against these tables to get the state of the PLC I/O MI/MB, etc.

    This would prevent the main UI thread from needless looping through the PLC inputs to see what's changed.

    If this is feasible could there be a second set of tables, for example WriteInput, WriteMI, WriteMB, etc, that would receive the changes from the UI thread and again using the row changed event to write these values back to the PLC as a "Batch", possibly bundling the read with the write events every .5 seconds to send back to the PLC.

    I realize there may be slight latency issues with the serial port.

    Am I making this more complicated that it needs to be?

    Thank you again for you guidence and patience!

  6. Good morning,

    I'm reviewing the .net verision of the Com Drive, I've got an applicaiton that requires serial communication between the PC and the PLC occur on a seperate thread from the UI due to performance concerns.

    Has anyone done this successfuly and would you be willing to share the .net class code?

    Thanks a million, any help would get me out of a pickel.

    Aaron

×
×
  • Create New...