LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bertec Force Treadmill Remote Control

Solved!
Go to solution

Hello,

 

I am attempting to remotely control the Bertec split belt force instrumented treadmill via LabVIEW.  The Treadmill comes with PC software called  'Treadmill Control Panel 1.8.7' that allows for external software applications to remotely control it via a  TCP/IP connection. A detailed help file is provided by Bertec (see Treadmill Remote Control.txt attached). 

 

 

I am currently able to receive and decode the feedback packets being sent (see Bertec_TCP_Client.vi attached).

However, I am currently unable to control the treadmill with data I send from this software (see Bertec_TCP_Server.vi attached). 

 

I suspect this has something to do with the Treadmill rejecting the sent data packets either due to formatting or timing ( a packet is being received when the treadmill is sending a feedback packet and so it rejects it). 

 

* I have tried running just the Bertec_TCP_Server.vi and I still can't seem to control the treadmill. 

* I have used this MatLab code repository as a guide https://github.com/willpower2727/HMRL-Matlab-Treadmill-Functions

 

 

 

 

 

 

 

0 Kudos
Message 1 of 4
(3,777 Views)

Have you tried to ping the treadmill with a LabVIEW application from you remote computer?

 

You could see in the third post of this forum how to ping with a simple LabVIEW application 

https://forums.ni.com/t5/LabVIEW/How-to-Ping-Hardware-via-TCP-IP/td-p/496764

Message 2 of 4
(3,726 Views)

Good thought. Yes, thanks, I just tried this and seems to have no trouble successfully pinging the treadmill using the vi in the thread you posted. 

0 Kudos
Message 3 of 4
(3,719 Views)
Solution
Accepted by topic author sam.blades

Update. Bertec finally sent an updated and more detailed version of their help document (see attached) with a specific example for the packet formatting which simplified matters immensely. 

Here is their example:

Example Setpoint Packet

Assume following parameters:

  • right belt speed: 2.0 m/s = 0x07D0 mm/s,
  • left belt speed: 1.0 m/s = 0x03E8 mm/s,
  • right belt acceleration: 0.25 m/s2 = 0x00FA mm/s2,
  • left belt acceleration: 0.5 m/s2 = 0x01F4 mm/s2
  uint8_t format = 0;
  int16_t belt_speed[4] =       { 0x7D0, 0x3E8, 0, 0 };
  int16_t belt_acceleration[4] = { 0xFA, 0x1F4, 0, 0 };
  int16_t incline_angle = 0;
  int16_t belt_speed_complement[4] =        { 0xF82F, 0xFC17, 0xFFFF, 0xFFFF };
  int16_t belt_acceleration_complement[4] = { 0xFF05, 0xFE0B, 0xFFFF, 0xFFFF };
  int16_t incline_angle_complement = 0xFFFF;
  uint8_t padding[27];

Manually setting the belt speed and accelerations requires converting the speed in m/s to mm/s and the acceleration from m/s/s to mm/s/s  and then converting them into the appropriate format of int 16 bytes as a string using the 'flatten to string' function within the Int 16 to bytes vi. The bit complement version of each int 16 number is also created within the Int 16 2 bytes vi by using the 'not' Boolean function.  

0 Kudos
Message 4 of 4
(3,673 Views)