Add a COP function block, variables, and contact (MSG_CIPGENERIC)

Use the following steps to add a COP function block, variables, and a contact. The COP instruction is used to convert data from the source data type (for example, DINT or REAL) to the destination data type. In this example, the catalog information is converted to a human readable string.
To add a COP function block, variables, and contact (MSG_CIPGENERIC)
  1. From
    Toolbox
    , drag Add branch button to the ladder language editor under the first rung.
  2. In
    Toolbox
    , in
    Search
    , enter
    COP
    , and then drag it to the second ladder rung.
  3. Add local input variables for COP.
    1. In
      Project Organizer
      , under your program, right-click
      Local Variables
      .
    2. In the local variable gird, add variables according to the following table:
      Variables to be added
      Parameter
      Variable name
      Data type
      Src
      MyResData
      Array USINT
      SrcOffset
      0
      UINT
      Dest
      CatalogID
      Array STRING
      DestOffset
      0
      UINT
      Length
      1
      UINT
      Swap
      FALSE
      BOOLEAN
  4. For the CatalogID variable, double-click
    Dimension
    , and then change the array size to [1..1]
  5. Add a contact.
    1. In
      Toolbox
      , in the search box, enter
      XIC
      , and then drag it to the left of the COP function block input on the second ladder rung.
    2. Right-click the XIC, and then select
      Select variable
      .
    3. In the local variable selector, select
      Convert_String
      , and then select
      Select
      .
    The second rung of your ladder diagram program for MSG_CIPGENERIC messaging looks similar to the following image:
    The second rung of MSG_CIPGENERIC messaging
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal