• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
March 28, 2024, 05:32:42 pm

News:

SMF - Just Installed!


Question on use of nrCommLib.Com

Started by Jukka, December 11, 2017, 05:55:33 am

Previous topic - Next topic

Jukka

December 11, 2017, 05:55:33 am Last Edit: December 11, 2017, 06:32:32 am by Jukka
Trying to send messages using astm. But is this how I should do it

          nrAstm1.SendRecord(@"H|\^&|||1^ASTM_TESTER^|||||||P||20120516000001");
          nrAstm1.SendRecord(@"P|1");
          nrAstm1.SendRecord(@"O|1|SampleID||^^^TestID|R||||||X||||1||||||||||F");
          nrAstm1.SendRecord(@"R|1|^^^TestID^0|100|IU_ml||||F||||20120508160203");
          nrAstm1.SendRecord(@"L|1|N");


Or it should be like this?

          string str = @"H|\^&|||1^ASTM_TESTER^|||||||P||20120516000001" + "\r" +
            @"P|1" + "\r" +
            @"O|1|SampleID||^^^TestID|R||||||X||||1||||||||||F" + "\r" +
            @"R|1|^^^TestID^0|100|IU_ml||||F||||20120508160203" + "\r" +
            @"L|1|N" + "\r";
          ;
          nrAstm1.SendRecord(str);
          nrAstm1.WaitForAck();

Roman Novgorodov

Hello

The first way is more correct.
TnrAstm.SendRecord() checks length and add necessary END char. You do not need to use '\r' separator in string argument.

Roman Novgorodov
DeepSoftware llc
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.