jamesdlee Posted May 27, 2015 Share Posted May 27, 2015 Hi, I am communicating with an instrument (device name t500u) using a serial link and using the 'poll' command to get data. But I would like to be able to log text strings of the instrument status. Currently in a sequence I send the command: private string datain = device.t500u.Poll("V MODE" + chr(013),13) and it returns the line (viewed in the comm monitor): V 147:14:05 0000 SAMPLE\013\010 I would like to be able to get the string SAMPLE into a channel that I can log alongside my data. SAMPLE could also be CAL, ZERO or AREF depending on the instrument status. Any help would be much appreciated! Thanks Link to comment Share on other sites More sharing options...
AzeoTech Posted May 27, 2015 Share Posted May 27, 2015 Its hard to tell, but is the device returning fixed length fields? If so, you'd just need to count how far over the SAMPLE appears, and use the mid() function to extract it. Link to comment Share on other sites More sharing options...
jamesdlee Posted May 28, 2015 Author Share Posted May 28, 2015 Yes that start of the text string is always in the same place, although the length of the word can vary. I just wasn't sure if text strings could be stored in a channel. Link to comment Share on other sites More sharing options...
AzeoTech Posted May 28, 2015 Share Posted May 28, 2015 Create a test string channel, so Device Type "Test", I/O type "String". Link to comment Share on other sites More sharing options...
jamesdlee Posted May 28, 2015 Author Share Posted May 28, 2015 Great thanks that works now! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.