{"id":3545,"date":"2019-02-12T16:09:22","date_gmt":"2019-02-12T16:09:22","guid":{"rendered":"https:\/\/cyflexdoc.wpengine.com\/usage-help-manual\/8-smart-instrument-interfaces\/dc_genstream\/"},"modified":"2026-01-12T13:10:09","modified_gmt":"2026-01-12T18:10:09","slug":"dc_genstream","status":"publish","type":"page","link":"https:\/\/cyflex.com\/index.php\/usage-help-manual\/16-smart-instrument-interfaces\/dc_genstream\/","title":{"rendered":"dc_GenStream"},"content":{"rendered":"<div>\n<h3>Purpose:<\/h3>\n<\/div>\n<dl>\n<dd>\n<p>Continuously retrieve data from a device and store it in a circular buffer for access via specified commands.<\/p>\n<\/dd>\n<\/dl>\n<h3>Enter:<\/h3>\n<dl>\n<dd>\n<p><strong>dc_GenStream<\/strong> [spec_file=filename]<\/p>\n<\/dd>\n<\/dl>\n<h3>Where:<\/h3>\n<dl>\n<dd>\n<div>\n<table cellspacing=\"0\" cellpadding=\"0\">\n<colgroup>\n<col \/>\n<col \/> <\/colgroup>\n<tbody>\n<tr>\n<td>\n<p>spec_file<\/p>\n<\/td>\n<td>\n<p>Optional. Specify the specification file to use to configure the task.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/dd>\n<\/dl>\n<h3>Example:<\/h3>\n<dl>\n<dd>\n<p><strong>dc_GenStream<\/strong> \/specs\/hydrometer.spec &amp;<\/p>\n<\/dd>\n<\/dl>\n<p><span style=\"font-size: 14pt;\"><strong>Notes<\/strong>:<\/span><\/p>\n<dl>\n<dd>\n<p>You can change the size of a message by changing the environmental variable streamSize in the terminal, default is 1023.<\/p>\n<p>Also normally used in conjunction with devcom_mon task to run the commands.<\/p>\n<p>A sample spec file can be found at cyflex\/specs.def\/ called genstream.spec.<\/p>\n<p>A sample devcom_mon can be found at cyflex\/specs.def\/ called genstream_mon.spec.<\/p>\n<p>$Device \u00a0<br \/>\n# serail port:baud,bits,stobits,parity,flow control(HW,XON,NONE$-$HW default) \u00a0<br \/>\n#IP:port \u00a0<br \/>\n#192.168.83.20:502 \u00a0<br \/>\n\/dev\/ttyS0:9600,8,1,N,NONE \u00a0<br \/>\n\u00a0<br \/>\n# maximum message rate is 1000 messages per second. \u00a0<br \/>\n$MaxMsgRate \u00a0<br \/>\n250 \u00a0<br \/>\n\u00a0<br \/>\n$Debug \u00a0<br \/>\ntrue \u00a0<br \/>\n\u00a0<br \/>\n$Timeout \u00a0<br \/>\n# default timeout in milliseconds \u00a0<br \/>\n#want to be higher than the amount it takes to get a message, usually 2 to 3 times higher \u00a0<br \/>\n2000 \u00a0<br \/>\n\u00a0<br \/>\n#Name task will attach to, or key name so multiple devices of same type can be supported. \u00a0<br \/>\n$Instrument \u00a0<br \/>\nOPTI \u00a0<br \/>\n\u00a0<br \/>\n#Protocol \u00a0<br \/>\n$Protocol \u00a0<br \/>\n\u00a0#GenSync &#8211; general asynchronous (streams data) serial\/socket protocol \u00a0<br \/>\nGenStream \u00a0<br \/>\n\u00a0<br \/>\n#message structure \u00a0<br \/>\n$CmdStruct \u00a0<br \/>\n\u00a0#Structure \u00a0<br \/>\n\u00a0<br \/>\n#\u00a0This\u00a0section\u00a0shows\u00a0the\u00a0sequence\u00a0of\u00a0message\u00a0elements \u00a0<br \/>\n#\u00a0H\u00a0=\u00a0header\u00a0string \u00a0<br \/>\n# M = message \u00a0<br \/>\n#S = station identifier<br \/>\n#\u00a0T\u00a0=\u00a0trailer\u00a0string \u00a0<br \/>\n#\u00a0C\u00a0=\u00a0crc \u00a0<br \/>\nMT<br \/>\n# response structure if any response expected \u00a0<br \/>\n$RspStruct \u00a0<br \/>\n\u00a0MT<br \/>\n$Header \u00a0<br \/>\n-1 \u00a0<br \/>\n\u00a0<br \/>\n# trailer \u00a0<br \/>\n$Trailer \u00a0<br \/>\n\u00a0&lt;CR&gt;&lt;LF&gt;<\/p>\n<p># NOTE: NONE supported at this time 7\/1\/10, will be added as needed.<br \/>\n$CRC \u00a0<br \/>\n-1 \u00a0<br \/>\n\u00a0<br \/>\n\u00a0#put True if you want to replace commas, will not work in ReplaceItems\u00a0<br \/>\n$ReplaceComma \u00a0<br \/>\n\u00a0<br \/>\n#not including commas because that is what seperates the list \u00a0<br \/>\n\u00a0#example: :,;,*,\/\u00a0\u00a0to replace : ; * and \/ all with spaces \u00a0<br \/>\n#note: does not work with the $ symbol \u00a0<br \/>\n\u00a0<br \/>\n$ReplaceItems \u00a0<br \/>\n:,;,! \u00a0<br \/>\n\u00a0<br \/>\n\u00a0#Command formats \u00a0<br \/>\n\u00a0#Command format Response format [timeout] \u00a0<br \/>\n\u00a0<br \/>\n$CmdDef \u00a0<br \/>\n\u00a0#Control Commands have no data response \u00a0<br \/>\n#CommandString formats AK_Command [Timeout(msec)] \u00a0<br \/>\n\u00a0#comma or tab delmited \u00a0<br \/>\n#Command key, [command arguments],[response],[timeout] \u00a0<br \/>\n\u00a0<br \/>\n#The getStream command is how you retrieve data from a device that is streaming information.<\/p>\n<p>#You can have multiple getStream commands for\u00a0 different formats, but you need to add numbers #at the end of the original command. Example: #getStream1, getStream2, etcldots \u00a0<br \/>\n#the format for the getStream command, you must find out what the device \u00a0<br \/>\n#output looks like. Once you have that, you must separate the output into \u00a0<br \/>\n#segments by spaces and tabs separating the segments. This includes the \u00a0<br \/>\n#spaces from the ReplaceItems.\u00a0\u00a0<\/p>\n<p>#Example:<br \/>\n#A\u00a0device\u00a0is\u00a0streaming\u00a0\u00a0\u00a0tds:mv=.45\u00a0dp=31\u00a0ret54d1 <br \/>\n#Before any replacements there are three segments. tds:mv=.45 , dp=31 , \u00a0<br \/>\n#and ret54d1. If we wanted the tds and the .45 from the first segment, we \u00a0<br \/>\n#would put &#8216;:&#8217; for or ReplaceItems list and it would split the 1st segment\u00a0\u00a0<br \/>\n#into 2 segments, tds and mv=.45 for a total of 4 segments now. To get \u00a0<br \/>\n#the .45 and 31, we do not need to replace anything additionally. The \u00a0<br \/>\n#format %f is smart enough to parse the first number it sees. However, \u00a0<br \/>\n#that would not be enough to parse the last segment, so if we wanted \u00a0<br \/>\n#certain data there, we would need to parse further. So with the first \u00a0<br \/>\n#parse, %s %f %f %s would be enough if we did not need anything from the \u00a0<br \/>\n#last segment. \u00a0<br \/>\n\u00a0<br \/>\ngetStream, -,%s %f %f %s \u00a0<br \/>\n\u00a0<br \/>\n# this section should end with a $\u00a0<\/p>\n<p>$<\/p>\n<\/dd>\n<\/dl>\n<p><span style=\"font-size: 14pt;\"><strong>See Also:<\/strong><\/span><\/p>\n<dl>\n<dd>\n<div><a href=\"https:\/\/cyflex.com\/wp-content\/uploads\/Device-Communication-User-Guide.pdf\">Device Communication User Guide<\/a><\/div>\n<\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>Purpose: Continuously retrieve data from a device and store it in a circular buffer for access via specified commands. Enter: dc_GenStream [spec_file=filename] Where: spec_file Optional. Specify the specification file to use to configure the task. Example: dc_GenStream \/specs\/hydrometer.spec &amp; Notes: You can change the size of a message by changing the environmental variable streamSize in [&hellip;]<\/p>\n","protected":false},"author":47,"featured_media":0,"parent":1955,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3545","page","type-page","status-publish","hentry"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/pages\/3545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/users\/47"}],"replies":[{"embeddable":true,"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/comments?post=3545"}],"version-history":[{"count":0,"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/pages\/3545\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/pages\/1955"}],"wp:attachment":[{"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/media?parent=3545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}