xeonfusion / VSCaptureDrgVent

VSCapture module to capture numeric and real time data from Draeger (Medibus.X protocol) ventilators
7 stars 9 forks source link

Constant Checksum Errors #7

Open marcgallego opened 1 year ago

marcgallego commented 1 year ago

Hi, I am trying to extract data from a Drager Babylog 8000 plus using your code.

I've adapted the serial port parameters to use the device defaults (BaudRate = 9600 and Parity = None), and made sure that those are the ones set up in the device. I am not trying to extract waveform data.

It sometimes works and outputs something like this:

01  35 02  9.503  9.505 0.6406 0.7307  1.008  1.109 43.90B  4.011 10.013 28.014  1.018 2.2719 0.901D 15  2A  20 2B 100 40  8.541 80

Inspiratory_oxygen_fraction:   35
Inspiratory_flow:   9.5
Time_interval_between_sighs:   9.5
Inspiratory_time:  0.64
Expiratory_time:  0.73
IE_I_part:   1.0
IE_E_part:   1.1
Respiratory_rate:  43.9
Positive_end_expiratory_pressure:   4.0
Apnea_alarm_time:  10.0
Pressure_limitation:  28.0
Number_of_respiratory_cycles_per_sigh:   1.0
Delay_for_minute_volume_higH:  2.27
Delay_for_minute_volume_low_alarm:  0.90
UnknownID:  15
Frequency_during_HFO:   20
UnknownID:  100
Inspiratory_tidal_volume_mL:   8.5
UnknownID:  80
038Modo A/C♥

UnknownID: Modo A/C

But many times the only output I get is Checksum Error. Do you have any idea of why this might be happening? Is it normal?

Thank you very much for the original code and for the help!

xeonfusion commented 1 year ago

Can you attach the .raw debug file generated by the app? One of the reasons for checksum errors is the RS232 chipset of the USB serial cable itself. Brands with FTDI chipset generally have fewer checksum issues. Another possibility is the MEDIBUS command response sequence not being in sync and causing few corrupt responses.

marcgallego commented 1 year ago

Thank you very much for your answer! I have doing some tests and apparently setting nInterval = 2 seems to drastically improve the situation. I am using a computer with a DB-9 port. My setup consists of a DB9 M/M gender changer and a RS232 serial null modem cable, no USBs. It may be the sync problem you mention, I'm not sure!

Here you have the lastest raw file I have: DrgVentRawoutput.raw

xeonfusion commented 1 year ago

Marc can you share the actual binary .raw file generated by the program (needed for simulation)? The file shared is a text file.

marcgallego commented 1 year ago

Sure, check with this: DrgVentRawoutput.zip

marcgallego commented 1 year ago

I've been conducting more tests, I've modified DebugLine so that it writes to console. I've found out that from time to time, there is already communication before pressing a key to start. In those cases, is when I get checksum errors. Do you know how can I fix this?

Press any key to continue...
03:55:16.040 - Received: ICC request
03:55:16.241 - Send: Request DevID
03:55:16.242 - Received: Device ID request
03:55:16.275 - Send: Device ID (response)
03:55:16.340 - Received: Device ID response
03:55:16.341 - Send: Request Realtime Config
03:55:16.420 - Received: Realtime Config Response
03:55:18.357 - Received: NOP request
03:55:20.400 - Received: NOP request

Requesting Transmission from monitor

Data will be written to CSV file DrgVentExportData.csv in same folder
03:55:21.389 - Send: Request ICC
03:55:21.595 - Send: Request Data CP1
03:55:21.599 - Send: NOP
03:55:21.629 - Received: ICC response
03:55:21.630 - Send: Request DevID
03:55:21.635 - Received: Device ID request
03:55:21.664 - Send: Device ID (response)
xeonfusion commented 1 year ago

Some of the checksum errors could be due to the command response sequence being out of sync in the Medibus life cycle (ICC request or Dev ID request). Similar to this discussion: https://github.com/xeonfusion/VSCaptureDrgVent/issues/4 Let’s debug this further, PM me.