Kpotmake Posted November 23, 2021 Report Share Posted November 23, 2021 I'm trying to draw a pattern on a screen with the insert shape function, and so far everything is working, but I would like to know where I could find some documentation on these functions? They don't seem to be included in the help file. I did open the example project 'draw_shape', and this has been helpfull in creating the first setup, but there are still a lot of questions left unanswered. For instance: -What is the maximum amount of shapes per group before I receive the error message from the insert shape function block 'maximum shapes reached' (error -8)? -When is the shape inserted in the group? On the rising edge of the input or does it keep adding shapes as long as the input is high? Same question for draw shape group function block -What is the maximum thickness for a line / rectangle before I receive the error message -2? Edit: seems to be 10 -Is it possible to create a solid circle / rectangle instead of just the border lines? Edit: since I haven't received any replies I made a loop that creates an increasingly smaller triangle / circle to fill the shape -Are the available colors defined somewhere? Edit: the color codes seem to be HTML color codes (https://htmlcolorcodes.com/) To anyone who wishes to implement this function, this is what I have found out so far: When you want to draw a grid from a data table (this was the case for me), when you want to loop through the data table to copy the X0 X1 Y0 Y1 coordinates from the data table to the shape line, you must include the status of the clear, insert shape and draw functions as a requirement before inserting a new shape (last insert / clear / draw must be finished before starting a new action), don't insert / clear / draw a new shape if status is <> 0. Also I found it worked flawlessly if I only trigger the function block once, so immediatly reset the starting condition once the insert shape function block is busy (again, you can monitor if it's busy by checking status <> 0). The easiest way to achieve this is with a state machine Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.