Master-Slave 06/2005
Danaher
Motion
114 Rev
E
M-SS-005-03l
If you are using a static table, use the Windows-based tools. This method is
simpler and you have more tools available with which to graph and analyze
the cam table.
You can create point-pairs using windows applications such as a text editor,
spread sheets (Excel), or mathematical programs (MatLab). For
spreadsheets, create a new sheet with two columns and one row for each
point-pair.
Do not
include a row for headings and
do not
include any other
information within the sheet. The first element of each row is the master
position. The second is the corresponding slave position. The master
position must increase or decrease with each point-pair as long as it is
monotonic. Its value cannot change directions (i.e.
,
increase and then
decrease) or stay the same.
When the table is complete, save to a Comma Separated Variable or .CSV
file. This is a text file format with one line for each point-pair and commas
between the master and slave values. For a five-point cam table, the .CSV
file looks like:
10, 20
20, 40
30, 60
40, 80
50, 100
When you add the .CSV file to your project, BASIC Moves converts it to a
cam table and stores it in the MC.
When building a cam table using MC-BASIC, first globally allocate cam
storage. Use
Common Shared <var> as Cam
:
Common Shared CAM1 as Cam
Here, CAM1 is used as the name. Replace CAM1 with any legal MC name.
The easiest way is to include this line in Config.Prg and reboot the MC. The
alternative is to enter this at the terminal window. Remember that the effect
of this line persists only until the MC resets.
Using MC-BASIC, create storage for the table of point-pairs. First, select a
task to calculate the point pairs and enter the following line in that task:
Program CamMaker
CreateCamData 5 CAM1
This allocates five data points for CAM1. Essentially two arrays (of size 5)
are created that are named CAM1.MASTERDATA and CAM1.SLAVEDATA.
Calculate the point-pairs to use in MC-BASIC. Build loops and iterate through
the array. The array is 1-based and you receive an error if you go outside the
bounds of this array. For this example, the points are simply loaded:
CAM1.MasterData[1]=10
CAM1.SlaveData[1]=20
CAM1.MasterData[2]=20
CAM1.SlaveData[2]=40
CAM1.MasterData[3]=30
CAM1.SlaveData[3]=60
CAM1.MasterData[4]=40
CAM1.SlaveData[4]=80
CAM1.MasterData[5]=50
CAM1.SlaveData[5]=100
Finally, store the table on the flash disk. If you use:
StoreCamData MyCam.Cam Cam1