123 else |
123 else |
124 dll_file_name = "can_uvccm_win32.dll"; |
124 dll_file_name = "can_uvccm_win32.dll"; |
125 |
125 |
126 if (argc > 3) |
126 if (argc > 3) |
127 MasterBoard.baudrate = argv[3]; |
127 MasterBoard.baudrate = argv[3]; |
|
128 |
|
129 if (argc > 4) |
|
130 MasterBoard.busname = argv[4]; |
128 |
131 |
129 // load can driver |
132 // load can driver |
130 if (!LoadCanDriver(dll_file_name)) |
133 if (!LoadCanDriver(dll_file_name)) |
131 { |
134 { |
132 printf("ERROR: could not load diver %s\n", dll_file_name); |
135 printf("ERROR: could not load diver %s\n", dll_file_name); |
156 if (GetChangeStateResults(node_id, Operational, 3000) != 0xFF) |
159 if (GetChangeStateResults(node_id, Operational, 3000) != 0xFF) |
157 { |
160 { |
158 /* modify Client SDO 1 Parameter */ |
161 /* modify Client SDO 1 Parameter */ |
159 UNS32 COB_ID_Client_to_Server_Transmit_SDO = 0x600 + node_id; |
162 UNS32 COB_ID_Client_to_Server_Transmit_SDO = 0x600 + node_id; |
160 UNS32 COB_ID_Server_to_Client_Receive_SDO = 0x580 + node_id; |
163 UNS32 COB_ID_Server_to_Client_Receive_SDO = 0x580 + node_id; |
161 UNS32 Node_ID_of_the_SDO_Server = node_id; |
164 UNS8 Node_ID_of_the_SDO_Server = node_id; |
162 UNS32 ExpectedSize = sizeof (UNS32); |
165 UNS32 ExpectedSize = sizeof(UNS32); |
|
166 UNS32 ExpectedSizeNodeId = sizeof (UNS8); |
163 |
167 |
164 if (OD_SUCCESSFUL == writeLocalDict(&win32test_Data, 0x1280, 1, &COB_ID_Client_to_Server_Transmit_SDO, &ExpectedSize, RW) |
168 if (OD_SUCCESSFUL == writeLocalDict(&win32test_Data, 0x1280, 1, &COB_ID_Client_to_Server_Transmit_SDO, &ExpectedSize, RW) |
165 && OD_SUCCESSFUL == writeLocalDict(&win32test_Data, 0x1280, 2, &COB_ID_Server_to_Client_Receive_SDO, &ExpectedSize, RW) |
169 && OD_SUCCESSFUL == writeLocalDict(&win32test_Data, 0x1280, 2, &COB_ID_Server_to_Client_Receive_SDO, &ExpectedSize, RW) |
166 && OD_SUCCESSFUL == writeLocalDict(&win32test_Data, 0x1280, 3, &Node_ID_of_the_SDO_Server, &ExpectedSize, RW)) |
170 && OD_SUCCESSFUL == writeLocalDict(&win32test_Data, 0x1280, 3, &Node_ID_of_the_SDO_Server, &ExpectedSizeNodeId, RW)) |
167 { |
171 { |
168 UNS32 dev_type = 0; |
172 UNS32 dev_type = 0; |
169 char device_name[64]=""; |
173 char device_name[64]=""; |
170 char hw_ver[64]=""; |
174 char hw_ver[64]=""; |
171 char sw_ver[64]=""; |
175 char sw_ver[64]=""; |