|
Once you have created the graphical representation of a function block, you need to add connection pins if you want to get data into and out of the function block. The location of the pin tool is shown below. When you click on the pin tool, a pin will appear at the mouse and a Pin Tool Options dialog will appear. Click the orientation radio button as applicable in the tool options. The end of the pin with a very tiny "X" should be away from the symbol as this is the connection "hot spot". The plain end of the pin should be placed on the perimeter of the symbol (this is for appearance, location does not matter for functionality).
Pin numbers will automatically increment (unless you have configured Options for decrement) as you continue to place more pins around the function block.
Once pins have been placed, there are two pieces of information that must be provided for each pin. Correct operation of the function block will affected by these two items. (1) Each pin in the function block must have a unique name. The pin number is not used in i.CanDrawIt, and pin numbers can be turned off by unchecking the box in front of "Number". But pin name IS IMPORTANT as this becomes part of variable names in code that will be generated for this function block. (2) The Data Flow direction must be set correctly. If this is not correct, and input is specified where it should be output or vice versa, there may be errors at the error check step in code generation. There will also possibly be errors at code compile time with data type mismatch. Pins defined as input will turn into code which expects to read variables belonging to other function blocks. Pins defined as output will turn into code that creates a local variable and stores the result of the function block in that variable.
After setting up all of the necessary pins, simply close this window. You will automatically be asked whether to save changes to the function block. When you click Yes, you will be taken to the next dialog for function block creation. NEXT-> |