Thanks! but i still wonder so how can i get get target_Table first?
Create a From tag (you can find the From block in the Library Browser). Then when you open it, click “UpdateTags” and then the Goto tag drop down will have a list of a whole bunch of available tags (these are the ones we provide for you use – you can see them described in the task programming guide in section 10.9 Available ‘Tags’ (From and Goto Blocks), Target_Table is one of the available tags and it contains a matrix that corresponds to the entire target table in your task protocol.
You can create your own Goto tags and corresponding From tags. Having a Goto and a From is the same thing as drawing a line between the two points. It’s just not as messy.
The kinematics are available from the From KINdata_bus, for example.
if i want to use selector to output an array called homeXY, homeXY[0] is the x value of home position, homeXY[1] is the y value of home position so that i can use the value in simulink, then what output size value should i put in the selector in your picture?
It’s already set up that way. The way it’s set up in the picture is it outputs a two element vector, [col_x col_y]. If you look in the Parameter Table Defn block Target Table tab, col_x = 1 and col_y is a constant = 2.
The selector (as set up there), will go to the Target Table get the elements Target_Table(home_target_row, 1:2). If you plug the output from the selector into a MATLAB function (you could call the input variable homeXY and you’ll have access to that 2 element vector.
As well, in Simulink (outside of default C based Stateflow), arrays are indexed starting at 1.
Cheers,
Koloman
if i want to use selector to output an array called homeXY, homeXY[0] is the x value of home position, homeXY[1] is the y value of home position so that i can use the value in simulink, then what output size value should i put in the selector in your picture?
But when i try to call homeXY[2], the simulink shows coder error: Subscript [2] out of range for matrix Input Data ‘homeXY’ (#1621). Valid subscript range is 0…1 Please refer to object.
btw, do u know how can i upload images on this forum? so that i can describe my problem more clearly.
If you edit a comment, there’s an icon for inserting images that are uploaded to the Internet.
You can always send images or models to our support email (support@bkintechnologies) as well if you want to be more detailed.
Please login or Register to submit your answer