Written by

Question Jainam Shah · Feb 25

ASTM E1394 message received as single line – segments not splitting in EnsLib.EDI.ASTM.Service.TCPService

Hi Team,

I am working on an ASTM interface using EnsLib.EDI.ASTM.Service.TCPService.

Environment

InterSystems Ensemble / IRIS (please specify your exact version)

Service class extending:

Class Custom.ASTM.Service.TCPService
Extends EnsLib.EDI.ASTM.Service.TCPService
{
Parameter EOTOPTIONAL = 1;

Parameter ADAPTER = "Custom.EDI.ASTM.Adapter.TCPAdapter"
}

Custom Adapter:

Include EnsEDIASTM
Class Custom.EDI.ASTM.Adapter.TCPAdapter Extends EnsLib.EDI.ASTM.Adapter.TCPAdapter
{
/// Use Carriage Return (ASCII 13) as line terminator
Property Terminators As %String [ InitialExpression = {$C(13)} ];
}
Scenario

I am receiving ASTM messages directly from a laboratory cdruby instrument (not using telnet or simulator).

Initially, I was getting an ASTM protocol error related to EOT.
After setting:

Parameter EOTOPTIONAL = 1;

the transmission worked.

However, now the ASTM message is being received as a single line, instead of being parsed into proper segments (H, P, O, R, L). I tried implementing ASCII 13, but still getting same issue.

In Message Viewer → Contents tab, the entire message appears inline instead of separate segments.

Error Observed

I am also seeing this error:

Build Map Status: ERROR <EnsEDI>ErrMapDocType: 
No ASTM schema structure is defined for DocType 'E1394'
Current Service Configuration

Framing: ASTM

DocType: E1394

EOTOptional: Enabled

(Please advise if I should be using ASTM:E1394 instead of just E1394.)

My Questions

   Why is the ASTM message not splitting into segments?

   Could this be due to:

   Instrument sending LF (0x0A) instead of CR (0x0D)?

   Incorrect DocType configuration?

   Schema category mismatch?

Is additional configuration required in ASTM TCPService to handle CRLF?

Any guidance on correct configuration for ASTM E1394 parsing would be greatly appreciated.

Thank you.

Product version: Ensemble 2018.1

Comments

DC AI Bot · Feb 25 Bot

To address the issue of ASTM E1394 messages arriving as a single line instead of being segmented, you might need to modify the behavior of your custom adapter to ensure proper handling of terminators.

The Terminators property in the adapter, which defines the line terminator, must appropriately reflect the actual terminator used by the instrument. By default, this property in the standard adapter uses $C(10) (line feed), but your instrument might use $C(13) (carriage return). You have already set the Terminators property to $C(13). If messages are still received as a single line and not splitting, consider checking if the instrument is indeed sending $C(13) consistently or if it uses another combination, like $C(13,10).

Additionally, ensure that your custom service class references the custom adapter. An example setup could be:

Class Custom.EDI.ASTM.Adapter.TCPAdapter Extends EnsLib.EDI.ASTM.Adapter.TCPAdapter {
  /// Use Carriage Return (ASCII 13) as line terminator
  Property Terminators As %String [ InitialExpression = {$C(13)} ];
}

Class Custom.EDI.ASTM.Service.TCPService Extends EnsLib.EDI.ASTM.Service.TCPService {
  Parameter ADAPTER = "Custom.EDI.ASTM.Adapter.TCPAdapter";
}

Deploy the custom service in your production setup, ensuring that other relevant configuration settings, such as framing and DocType, are correct.

If the terminator mismatch persists, or if the instrument sends additional framing characters affecting separation, you may need to analyze the raw data for confirmation or consult with the device vendor regarding the exact output format to align your configuration accordingly 1.

情報源:

Tell us more:
Don't like the style
Not factually correct
Didn't fully follow instructions
Refused when it shouldn't have
Being lazy
More...
Submit
0 0