Examples RunHartSlave with ConnectAndRead

 

Featuring the Slave Interface of the DLL

If you are using a virtual pair of com ports you can conduct this session on one computer. Otherwise you need two machines or two cross-connected com ports.

 

Running the Hart Salve

 

1. Open RunHartSlave.sln with Visual Studio 2005, build the solution and start debugging.

 

 

2. Select a com port. If the com port could be opened its state is reported as 'Com Port O.K.'.

 

3. Check 'Slave Activated'. Now you see a simulated measured value counting up and down.

 

Running the Hart Master

 

1. Open ConnectAndRead.sln with Visual Studio 2005, build the solution and start debugging.

 

 

2. Select the other com port. If the com port could be opened the state will be reported as 'COM O.K.'.

 

3. Click the button 'Connect' to force the application to send command 0 for getting the unique identifier of the Hart Slave.

 

4. Check 'Cyclic Read PVs'. Now the simulated measured value will be read by the master as fast as possible (which is slower than the local update of the slave because of the delay introduced by the Hart communication).

 

A Closer Look to the Hart Slave

 

1. Start RunHartSlave.exe or start RunHartSlave.sln in the debugger.

 

 

2. Select a com port. If the com port could be opened its state is reported as 'Com Port O.K.'.

 

3. Check 'Slave Activated'. Now you see a simulated measured value counting up and down.

 

4. Start FrameAlyst

 

 

5. Click menu 'Connection->Test Client', select the other com port and check the option button 'Master'. Click the button 'OK'.

 

 

6. Click 'Send->Cmd 0 Short' to allow the FrameAlyst to get the unique identifier of the slave device.

 

 

7. Click 'Send->Cmd 13' to read tag descriptor and date.

 

 

8. Mark the first 18 octets in the data frame (black color) and click 'Decode->Packed ASCII'.

 

 

The FrameAlyst shows you the ASCII string:

 


The last three octets are
08: the day of the month,
0B: the month of the year (11 = November) and
6C: the year since 1900 (108 = 2008).

 

9. Click 'Send->Cmd 17'.

 

10. Enter the message: 'floatvar = 123.4' or 'floatvar = 123,4' depending on the country settings of your Windows system.

 

 

11. Click 'OK'.

 

If you look at the form of the Hart Slave simulation you will see
that the FloatVar parameter is set to the requested value.

 

 

12. Click 'Send->Cmd 17' again.

 

13. Enter the message: 'integervar=1111'.

 

 

14. Click 'OK'.

 

The IntegerVar parameter is now set to 1111.

 

 

Contact

Borst Automation
Im Wingert 4
DE-65626 Fachingen

GERMANY

Voice: +49 (0)6432 989176

Fax: +49 (0)6432 989129

Home: http://borst-automation.com

Email: info@borst-automation.de