<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.flowcode.co.uk/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=DanielM</id>
	<title>Flowcode Help - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.flowcode.co.uk/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=DanielM"/>
	<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Special:Contributions/DanielM"/>
	<updated>2026-05-01T16:33:05Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23471</id>
		<title>Using the Data Recorder</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23471"/>
		<updated>2019-05-17T08:02:37Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a Data Recorder ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside [[Ghost_Technology|Ghost Technology]] to allow users to monitor signals in real time using In-Circuit-Test. It can also be used in simulation mode, though timing of signals is not accurate when using simulation. In simulation, it allows the user to see the results and values from raw data and components such as dials and measures. This data allows you to monitor the state of the various signals plotted to various channels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_recorder_wave_and_packets.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Data Recorder is very useful for analyzing data as it can accurately display information to identify patterns in the data as well as the speed data is being displayed at. Components such as the DSP range will automatically create their own Data Recorder channels, allowing for very simple yet powerful means of monitoring and debugging the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
====Adding streams====&lt;br /&gt;
&lt;br /&gt;
Streams are separated via two types: user streams and program streams. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====User streams=====&lt;br /&gt;
&lt;br /&gt;
User streams are simple streams that allow you to easily monitor the value of a digital or analog pin. They can be added by simply clicking the “Add pin trace” button on the Data Recorder itself and selecting the appropriate digital or analog pin. &lt;br /&gt;
&lt;br /&gt;
This method of adding streams is recommended if you are using [[Ghost_Technology|Ghost Technology]] to view live pin data from your Matrix hardware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_Recorder_Add_Data.png|x150px|border|Adding pins to the Data Recorder]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Program streams=====&lt;br /&gt;
&lt;br /&gt;
Program streams are added by components or by flowchart icons in your program. For some components, simply adding it to the 2d or 3d panel causes a program stream to appear in the Data Recorder. These streams are then controlled by the component itself and will be removed automatically when appropriate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SPI_Master_Streams.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we will give an example of creating your own program stream using flowchart icons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Creating a stream======&lt;br /&gt;
&lt;br /&gt;
To create a new stream group you first need to create a global “Handle” type variable to store the reference to the stream group. This is basically a unique number which used to refer to that specific group of streams in the Data Recorder. To do this, open the [[Project_Explorer|Project Explorer]] window and select the “Globals” tab. Next, under the “Variables” portion of the tree view, double-click “Add New” from the menu. In the “Create a New Variable” dialogue that pops up give the variable a meaningful name such as “DRGroupHandle”, then switch the variable type to “Object handle” and click “OK”. You should then get an Object handle variable appearing in the [[Project_Explorer|Project Explorer]] window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DRGroupHandle.png|border|150px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we need to assign the handle variable with a value by calling the Flowcode API. To do this we add a Simulation Macro (link) icon to the “Main” flowchart. Then we double-click the icon on the flowchart to edit the icon's properties. Inside the icon property window we first need to ensure that the “Functions” tab is selected and then scroll down to the “DataRecorder” section before clicking the + icon to see all the API calls related to the Data Recorder’s functionality. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderMacros.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddGroup|AddGroup]] function call creates a new named group of streams on the Data Recorder. The return value of the function call requires a handle type variable. You should set this to the name of the variable we have created previously (“DRGroupHandle” in this example). Type a name that you want into the parameter field, (such as “Test Group”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddGroup.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddStream|AddStream]] function call adds a new named stream to the group on the Data Recorder. The return value of the function call is a handle type variable. We will have to create a new global object handle type variable to store this. This handle must be unique for each single stream so you must use a new object handle variable for every program stream that you create on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddStream.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When we run the simulation the new group will be created on the Data Recorder ready for data to be streamed in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderStreamCreation.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are creating your own Flowcode component, you can move these from the Main macro to the [[Event_Components.Initialise|component initialise event]] macro so that the group and stream are created automatically when the component is added to a program. This is the way that components such as the DSP based components add their data to the console window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderEvInitialise.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that a group with no valid stream handles will not show up on the Data Recorder window, in order to avoid potential unnecessary clutter. &lt;br /&gt;
Setting the handle variable to the value of 0 using a [[Calculation_Icon_Properties|Calculation icon]] or calling the [[API_System.DeleteHandle|System -&amp;gt; DeleteHandle]] API call will remove the group or stream from the Data Recorder window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a digital pin or port to a program stream======&lt;br /&gt;
&lt;br /&gt;
A digital pin or port can be assigned to a stream object handle by using the [[API_Scope.AddPort|AddPort]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the port index where PORTA is 0, PORTB is 1 etc. &lt;br /&gt;
*the BitMask parameter. This is a binary AND mask which selects which bits of the port will be available on the stream. &lt;br /&gt;
*The PackMask parameter. Setting this to 1 will move all the active bits together if necessary. &lt;br /&gt;
*The merge parameter. This allows you to add multiple ports or pins to a single stream. Set this to 1 if you are adding a digital pin or port to an existing stream that already contains data, and you wish to combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single pin (e.g. Port A, Pin 0) with an LED connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddPort.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to toggle the LED with the signal being replicated on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderLED.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To monitor a full port (e.g. Port B) with a LED Array connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddFullPort.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then scale the stream to get the value in the range of 0-1 by calling the [[API_Scope.AddOp|AddOp]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddOp.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to generate a digital counter on Port B, with the signal being replicated on the Data Recorder. The [[API_System.ShowHandle|ShowHandle]] function allows the Data Recorder window to appear automatically without the user having to manually open the window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderLEDStrip.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding an analogue pin to a program stream======&lt;br /&gt;
&lt;br /&gt;
An analogue pin can be assigned to a stream object handle by using the [[API_Scope.AddAnalog|AddAnalog]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the analogue channel index where An0 is 0, An1 is 1 etc. &lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple analogue signals on a single stream. Set this to 1 if you are adding an analog pin to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single analogue pin (e.g. pin An0), with a potentiometer connected, we can call the [[API_Scope.AddAnalog|AddAnalog]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddAnalog.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the value of pin An0, based on the position of the potentiometer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderPotentiometer.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a custom value to a program stream======&lt;br /&gt;
&lt;br /&gt;
Custom values are those that do not correspond directly to pins or ports. A custom value can be assigned to a stream object handle by using the [[API_Scope.AddCustom|AddCustom]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the custom channel index 0-31. These act as “slots” in which to store your data. Select a value that is not used by any other custom streams.&lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple custom channels on a single stream. Set this to 1 if you are adding a custom channel to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data.&lt;br /&gt;
 &lt;br /&gt;
To create a single custom stream, we can call the [[API_Scope.AddCustom|AddCustom]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddCustom.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
The data for a custom channel cannot come from a digital or analogue channel automatically. Instead we have to manually pass the data to the custom channel. This is done by using the [[API_Scope.SetCustom|SetCustom]] function call. The value passed should be a floating-point real number in the range between 0 and 1 (so to convert a byte variable we would have to divide by the value 255.0.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderSetCustom.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program which creates a custom stream, adds custom channel 0 to it, and then continually:&lt;br /&gt;
# tracks the values of two analogue input signals&lt;br /&gt;
# calculates the average between the two readings. &lt;br /&gt;
# sends the data to custom channel 0, which appears on the Data Recorder in the created stream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderPotAverage.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Interacting with streams===&lt;br /&gt;
&lt;br /&gt;
You can change the time span that is being examined by using the drop down on the top-right of the window. Alternatively, you can use your mouse’s scroll wheel. Using the scroll wheel is even more powerful as it allows you to zoom directly over a particular point of interest.&lt;br /&gt;
Stream heights can be modified by dragging the bottom border of the left hand pane for the relevant stream. Colours used for rendering can be modified on the fly directly, by clicking the top square next to the stream name (for the stream background colour), and the bottom square next to the stream name (for the stream waveform/foreground colour)&lt;br /&gt;
&lt;br /&gt;
Hovering your mouse over the stream will show you the time interval between the two peaks that surround the cursor. Note that in simulation mode, this timing is not accurate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Packet Decoding===&lt;br /&gt;
&lt;br /&gt;
Communications buses can be decoded to work out what values a bus is sending out and receiving. &lt;br /&gt;
&lt;br /&gt;
Supported Busses:&lt;br /&gt;
*UART (RS232, GSM, GPS, Modbus, Bluetooth, ...) &lt;br /&gt;
*SPI (SPI Master, FAT, EEPROM, RTC, ...) &lt;br /&gt;
*I2C (I2C Master, Accelerometer, EEPROM, RTC, ...) &lt;br /&gt;
&lt;br /&gt;
Packet decoding is available for certain program streams added by components. The button for decoding becomes available when the relevant communication component is added to the panel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decode_button.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Decoding is then done by clicking the decode stream button on the appropriate stream. Streams can be decoded regardless of whether the Data Recorder is running in simulation or Ghost mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decoded_packets.png|border|600px]]&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23470</id>
		<title>Using the Data Recorder</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23470"/>
		<updated>2019-05-16T13:39:29Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a Data Recorder ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside Ghost Technology to allow users to monitor signals in real time using In-Circuit-Test. It can also be used in simulation mode, though timing of signals is not accurate when using simulation. In simulation, it allows the user to see the results and values from raw data and components such as dials and measures. This data allows you to monitor the state of the various signals plotted to various channels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_recorder_wave_and_packets.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Data Recorder is very useful for analyzing data as it can accurately display information to identify patterns in the data as well as the speed data is being displayed at. Components such as the DSP range will automatically create their own Data Recorder channels, allowing for very simple yet powerful means of monitoring and debugging the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
====Adding streams====&lt;br /&gt;
&lt;br /&gt;
Streams are separated via two types: user streams and program streams. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====User streams=====&lt;br /&gt;
&lt;br /&gt;
User streams are simple streams that allow you to easily monitor the value of a digital or analog pin. They can be added by simply clicking the “Add pin trace” button on the Data Recorder itself and selecting the appropriate digital or analog pin. &lt;br /&gt;
&lt;br /&gt;
This method of adding streams is recommended if you are using [[Ghost_Technology|Ghost Technology]] to view live pin data from your Matrix hardware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_Recorder_Add_Data.png|x150px|border|Adding pins to the Data Recorder]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Program streams=====&lt;br /&gt;
&lt;br /&gt;
Program streams are added by components or by flowchart icons in your program. For some components, simply adding it to the 2d or 3d panel causes a program stream to appear in the Data Recorder. These streams are then controlled by the component itself and will be removed automatically when appropriate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SPI_Master_Streams.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we will give an example of creating your own program stream using flowchart icons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Creating a stream======&lt;br /&gt;
&lt;br /&gt;
To create a new stream group you first need to create a global “Handle” type variable to store the reference to the stream group. This is basically a unique number which used to refer to that specific group of streams in the Data Recorder. To do this, open the [[Project_Explorer|Project Explorer]] window and select the “Globals” tab. Next, under the “Variables” portion of the tree view, double-click “Add New” from the menu. In the “Create a New Variable” dialogue that pops up give the variable a meaningful name such as “DRGroupHandle”, then switch the variable type to “Object handle” and click “OK”. You should then get an Object handle variable appearing in the [[Project_Explorer|Project Explorer]] window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DRGroupHandle.png|border|150px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we need to assign the handle variable with a value by calling the Flowcode API. To do this we add a Simulation Macro (link) icon to the “Main” flowchart. Then we double-click the icon on the flowchart to edit the icon's properties. Inside the icon property window we first need to ensure that the “Functions” tab is selected and then scroll down to the “DataRecorder” section before clicking the + icon to see all the API calls related to the Data Recorder’s functionality. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderMacros.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddGroup|AddGroup]] function call creates a new named group of streams on the Data Recorder. The return value of the function call requires a handle type variable. You should set this to the name of the variable we have created previously (“DRGroupHandle” in this example). Type a name that you want into the parameter field, (such as “Test Group”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddGroup.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddStream|AddStream]] function call adds a new named stream to the group on the Data Recorder. The return value of the function call is a handle type variable. We will have to create a new global object handle type variable to store this. This handle must be unique for each single stream so you must use a new object handle variable for every program stream that you create on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddStream.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When we run the simulation the new group will be created on the Data Recorder ready for data to be streamed in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderStreamCreation.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are creating your own Flowcode component, you can move these from the Main macro to the [[Event_Components.Initialise|component initialise event]] macro so that the group and stream are created automatically when the component is added to a program. This is the way that components such as the DSP based components add their data to the console window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderEvInitialise.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that a group with no valid stream handles will not show up on the Data Recorder window, in order to avoid potential unnecessary clutter. &lt;br /&gt;
Setting the handle variable to the value of 0 using a [[Calculation_Icon_Properties|Calculation icon]] or calling the [[API_System.DeleteHandle|System -&amp;gt; DeleteHandle]] API call will remove the group or stream from the Data Recorder window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a digital pin or port to a program stream======&lt;br /&gt;
&lt;br /&gt;
A digital pin or port can be assigned to a stream object handle by using the [[API_Scope.AddPort|AddPort]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the port index where PORTA is 0, PORTB is 1 etc. &lt;br /&gt;
*the BitMask parameter. This is a binary AND mask which selects which bits of the port will be available on the stream. &lt;br /&gt;
*The PackMask parameter. Setting this to 1 will move all the active bits together if necessary. &lt;br /&gt;
*The merge parameter. This allows you to add multiple ports or pins to a single stream. Set this to 1 if you are adding a digital pin or port to an existing stream that already contains data, and you wish to combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single pin (e.g. Port A, Pin 0) with an LED connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddPort.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to toggle the LED with the signal being replicated on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderLED.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To monitor a full port (e.g. Port B) with a LED Array connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddFullPort.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then scale the stream to get the value in the range of 0-1 by calling the [[API_Scope.AddOp|AddOp]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddOp.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to generate a digital counter on Port B, with the signal being replicated on the Data Recorder. The [[API_System.ShowHandle|ShowHandle]] function allows the Data Recorder window to appear automatically without the user having to manually open the window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderLEDStrip.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding an analogue pin to a program stream======&lt;br /&gt;
&lt;br /&gt;
An analogue pin can be assigned to a stream object handle by using the [[API_Scope.AddAnalog|AddAnalog]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the analogue channel index where An0 is 0, An1 is 1 etc. &lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple analogue signals on a single stream. Set this to 1 if you are adding an analog pin to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single analogue pin (e.g. pin An0), with a potentiometer connected, we can call the [[API_Scope.AddAnalog|AddAnalog]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddAnalog.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the value of pin An0, based on the position of the potentiometer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderPotentiometer.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a custom value to a program stream======&lt;br /&gt;
&lt;br /&gt;
Custom values are those that do not correspond directly to pins or ports. A custom value can be assigned to a stream object handle by using the [[API_Scope.AddCustom|AddCustom]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the custom channel index 0-31. These act as “slots” in which to store your data. Select a value that is not used by any other custom streams.&lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple custom channels on a single stream. Set this to 1 if you are adding a custom channel to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data.&lt;br /&gt;
 &lt;br /&gt;
To create a single custom stream, we can call the [[API_Scope.AddCustom|AddCustom]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddCustom.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
The data for a custom channel cannot come from a digital or analogue channel automatically. Instead we have to manually pass the data to the custom channel. This is done by using the [[API_Scope.SetCustom|SetCustom]] function call. The value passed should be a floating-point real number in the range between 0 and 1 (so to convert a byte variable we would have to divide by the value 255.0.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderSetCustom.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program which creates a custom stream, adds custom channel 0 to it, and then continually:&lt;br /&gt;
# tracks the values of two analogue input signals&lt;br /&gt;
# calculates the average between the two readings. &lt;br /&gt;
# sends the data to custom channel 0, which appears on the Data Recorder in the created stream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderPotAverage.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Interacting with streams===&lt;br /&gt;
&lt;br /&gt;
You can change the time span that is being examined by using the drop down on the top-right of the window. Alternatively, you can use your mouse’s scroll wheel. Using the scroll wheel is even more powerful as it allows you to zoom directly over a particular point of interest.&lt;br /&gt;
Stream heights can be modified by dragging the bottom border of the left hand pane for the relevant stream. Colours used for rendering can be modified on the fly directly, by clicking the top square next to the stream name (for the stream background colour), and the bottom square next to the stream name (for the stream waveform/foreground colour)&lt;br /&gt;
&lt;br /&gt;
Hovering your mouse over the stream will show you the time interval between the two peaks that surround the cursor. Note that in simulation mode, this timing is not accurate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Packet Decoding===&lt;br /&gt;
&lt;br /&gt;
Communications buses can be decoded to work out what values a bus is sending out and receiving. &lt;br /&gt;
&lt;br /&gt;
Supported Busses:&lt;br /&gt;
*UART (RS232, GSM, GPS, Modbus, Bluetooth, ...) &lt;br /&gt;
*SPI (SPI Master, FAT, EEPROM, RTC, ...) &lt;br /&gt;
*I2C (I2C Master, Accelerometer, EEPROM, RTC, ...) &lt;br /&gt;
&lt;br /&gt;
Packet decoding is available for certain program streams added by components. The button for decoding becomes available when the relevant communication component is added to the panel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decode_button.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Decoding is then done by clicking the decode stream button on the appropriate stream. Streams can be decoded regardless of whether the Data Recorder is running in simulation or Ghost mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decoded_packets.png|border|600px]]&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderPotAverage.png&amp;diff=23469</id>
		<title>File:DataRecorderPotAverage.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderPotAverage.png&amp;diff=23469"/>
		<updated>2019-05-16T13:38:38Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23468</id>
		<title>Using the Data Recorder</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23468"/>
		<updated>2019-05-16T13:30:02Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a Data Recorder ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside Ghost Technology to allow users to monitor signals in real time using In-Circuit-Test. It can also be used in simulation mode, though timing of signals is not accurate when using simulation. In simulation, it allows the user to see the results and values from raw data and components such as dials and measures. This data allows you to monitor the state of the various signals plotted to various channels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_recorder_wave_and_packets.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Data Recorder is very useful for analyzing data as it can accurately display information to identify patterns in the data as well as the speed data is being displayed at. Components such as the DSP range will automatically create their own Data Recorder channels, allowing for very simple yet powerful means of monitoring and debugging the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
====Adding streams====&lt;br /&gt;
&lt;br /&gt;
Streams are separated via two types: user streams and program streams. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====User streams=====&lt;br /&gt;
&lt;br /&gt;
User streams are simple streams that allow you to easily monitor the value of a digital or analog pin. They can be added by simply clicking the “Add pin trace” button on the Data Recorder itself and selecting the appropriate digital or analog pin. &lt;br /&gt;
&lt;br /&gt;
This method of adding streams is recommended if you are using [[Ghost_Technology|Ghost Technology]] to view live pin data from your Matrix hardware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_Recorder_Add_Data.png|x150px|border|Adding pins to the Data Recorder]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Program streams=====&lt;br /&gt;
&lt;br /&gt;
Program streams are added by components or by flowchart icons in your program. For some components, simply adding it to the 2d or 3d panel causes a program stream to appear in the Data Recorder. These streams are then controlled by the component itself and will be removed automatically when appropriate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SPI_Master_Streams.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we will give an example of creating your own program stream using flowchart icons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Creating a stream======&lt;br /&gt;
&lt;br /&gt;
To create a new stream group you first need to create a global “Handle” type variable to store the reference to the stream group. This is basically a unique number which used to refer to that specific group of streams in the Data Recorder. To do this, open the [[Project_Explorer|Project Explorer]] window and select the “Globals” tab. Next, under the “Variables” portion of the tree view, double-click “Add New” from the menu. In the “Create a New Variable” dialogue that pops up give the variable a meaningful name such as “DRGroupHandle”, then switch the variable type to “Object handle” and click “OK”. You should then get an Object handle variable appearing in the [[Project_Explorer|Project Explorer]] window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DRGroupHandle.png|border|150px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we need to assign the handle variable with a value by calling the Flowcode API. To do this we add a Simulation Macro (link) icon to the “Main” flowchart. Then we double-click the icon on the flowchart to edit the icon's properties. Inside the icon property window we first need to ensure that the “Functions” tab is selected and then scroll down to the “DataRecorder” section before clicking the + icon to see all the API calls related to the Data Recorder’s functionality. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderMacros.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddGroup|AddGroup]] function call creates a new named group of streams on the Data Recorder. The return value of the function call requires a handle type variable. You should set this to the name of the variable we have created previously (“DRGroupHandle” in this example). Type a name that you want into the parameter field, (such as “Test Group”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddGroup.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddStream|AddStream]] function call adds a new named stream to the group on the Data Recorder. The return value of the function call is a handle type variable. We will have to create a new global object handle type variable to store this. This handle must be unique for each single stream so you must use a new object handle variable for every program stream that you create on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddStream.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When we run the simulation the new group will be created on the Data Recorder ready for data to be streamed in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderStreamCreation.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are creating your own Flowcode component, you can move these from the Main macro to the [[Event_Components.Initialise|component initialise event]] macro so that the group and stream are created automatically when the component is added to a program. This is the way that components such as the DSP based components add their data to the console window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderEvInitialise.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that a group with no valid stream handles will not show up on the Data Recorder window, in order to avoid potential unnecessary clutter. &lt;br /&gt;
Setting the handle variable to the value of 0 using a [[Calculation_Icon_Properties|Calculation icon]] or calling the [[API_System.DeleteHandle|System -&amp;gt; DeleteHandle]] API call will remove the group or stream from the Data Recorder window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a digital pin or port to a program stream======&lt;br /&gt;
&lt;br /&gt;
A digital pin or port can be assigned to a stream object handle by using the [[API_Scope.AddPort|AddPort]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the port index where PORTA is 0, PORTB is 1 etc. &lt;br /&gt;
*the BitMask parameter. This is a binary AND mask which selects which bits of the port will be available on the stream. &lt;br /&gt;
*The PackMask parameter. Setting this to 1 will move all the active bits together if necessary. &lt;br /&gt;
*The merge parameter. This allows you to add multiple ports or pins to a single stream. Set this to 1 if you are adding a digital pin or port to an existing stream that already contains data, and you wish to combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single pin (e.g. Port A, Pin 0) with an LED connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddPort.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to toggle the LED with the signal being replicated on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderLED.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To monitor a full port (e.g. Port B) with a LED Array connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddFullPort.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then scale the stream to get the value in the range of 0-1 by calling the [[API_Scope.AddOp|AddOp]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddOp.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to generate a digital counter on Port B, with the signal being replicated on the Data Recorder. The [[API_System.ShowHandle|ShowHandle]] function allows the Data Recorder window to appear automatically without the user having to manually open the window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderLEDStrip.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding an analogue pin to a program stream======&lt;br /&gt;
&lt;br /&gt;
An analogue pin can be assigned to a stream object handle by using the [[API_Scope.AddAnalog|AddAnalog]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the analogue channel index where An0 is 0, An1 is 1 etc. &lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple analogue signals on a single stream. Set this to 1 if you are adding an analog pin to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single analogue pin (e.g. pin An0), with a potentiometer connected, we can call the [[API_Scope.AddAnalog|AddAnalog]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddAnalog.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the value of pin An0, based on the position of the potentiometer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderPotentiometer.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a custom value to a program stream======&lt;br /&gt;
&lt;br /&gt;
Custom values are those that do not correspond directly to pins or ports. A custom value can be assigned to a stream object handle by using the [[API_Scope.AddCustom|AddCustom]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the custom channel index 0-31. These act as “slots” in which to store your data. Select a value that is not used by any other custom streams.&lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple custom channels on a single stream. Set this to 1 if you are adding a custom channel to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data.&lt;br /&gt;
 &lt;br /&gt;
To create a single custom stream, we can call the [[API_Scope.AddCustom|AddCustom]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddCustom.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
The data for a custom channel cannot come from a digital or analogue channel automatically. Instead we have to manually pass the data to the custom channel. This is done by using the [[API_Scope.SetCustom|SetCustom]] function call. The value passed should be a floating-point real number in the range between 0 and 1 (so to convert a byte variable we would have to divide by the value 255.0.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderSetCustom.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program which creates a custom stream, adds custom channel 0 to it, and then continually:&lt;br /&gt;
# tracks the values of two analogue input signals&lt;br /&gt;
# calculates the average between the two readings. &lt;br /&gt;
# sends the data to custom channel 0, which appears on the Data Recorder in the created stream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope12.jpg]] &amp;lt;!-- custom program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Interacting with streams===&lt;br /&gt;
&lt;br /&gt;
You can change the time span that is being examined by using the drop down on the top-right of the window. Alternatively, you can use your mouse’s scroll wheel. Using the scroll wheel is even more powerful as it allows you to zoom directly over a particular point of interest.&lt;br /&gt;
Stream heights can be modified by dragging the bottom border of the left hand pane for the relevant stream. Colours used for rendering can be modified on the fly directly, by clicking the top square next to the stream name (for the stream background colour), and the bottom square next to the stream name (for the stream waveform/foreground colour)&lt;br /&gt;
&lt;br /&gt;
Hovering your mouse over the stream will show you the time interval between the two peaks that surround the cursor. Note that in simulation mode, this timing is not accurate.&lt;br /&gt;
&lt;br /&gt;
===Packet Decoding===&lt;br /&gt;
&lt;br /&gt;
Communications buses can be decoded to work out what values a bus is sending out and receiving. &lt;br /&gt;
&lt;br /&gt;
Supported Busses:&lt;br /&gt;
*UART (RS232, GSM, GPS, Modbus, Bluetooth, ...) &lt;br /&gt;
*SPI (SPI Master, FAT, EEPROM, RTC, ...) &lt;br /&gt;
*I2C (I2C Master, Accelerometer, EEPROM, RTC, ...) &lt;br /&gt;
&lt;br /&gt;
Packet decoding is available for certain program streams added by components. The button for decoding becomes available when the relevant communication component is added to the panel.&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decode_button.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
Decoding is then done by clicking the decode stream button on the appropriate stream. Streams can be decoded regardless of whether the Data Recorder is running in simulation or Ghost mode.&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decoded_packets.png|border|600px]]&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderSetCustom.png&amp;diff=23467</id>
		<title>File:DataRecorderSetCustom.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderSetCustom.png&amp;diff=23467"/>
		<updated>2019-05-16T13:29:12Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderAddCustom.png&amp;diff=23466</id>
		<title>File:DataRecorderAddCustom.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderAddCustom.png&amp;diff=23466"/>
		<updated>2019-05-16T13:28:56Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23465</id>
		<title>Using the Data Recorder</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23465"/>
		<updated>2019-05-16T13:21:19Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a Data Recorder ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside Ghost Technology to allow users to monitor signals in real time using In-Circuit-Test. It can also be used in simulation mode, though timing of signals is not accurate when using simulation. In simulation, it allows the user to see the results and values from raw data and components such as dials and measures. This data allows you to monitor the state of the various signals plotted to various channels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_recorder_wave_and_packets.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Data Recorder is very useful for analyzing data as it can accurately display information to identify patterns in the data as well as the speed data is being displayed at. Components such as the DSP range will automatically create their own Data Recorder channels, allowing for very simple yet powerful means of monitoring and debugging the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
====Adding streams====&lt;br /&gt;
&lt;br /&gt;
Streams are separated via two types: user streams and program streams. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====User streams=====&lt;br /&gt;
&lt;br /&gt;
User streams are simple streams that allow you to easily monitor the value of a digital or analog pin. They can be added by simply clicking the “Add pin trace” button on the Data Recorder itself and selecting the appropriate digital or analog pin. &lt;br /&gt;
&lt;br /&gt;
This method of adding streams is recommended if you are using [[Ghost_Technology|Ghost Technology]] to view live pin data from your Matrix hardware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_Recorder_Add_Data.png|x150px|border|Adding pins to the Data Recorder]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Program streams=====&lt;br /&gt;
&lt;br /&gt;
Program streams are added by components or by flowchart icons in your program. For some components, simply adding it to the 2d or 3d panel causes a program stream to appear in the Data Recorder. These streams are then controlled by the component itself and will be removed automatically when appropriate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SPI_Master_Streams.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we will give an example of creating your own program stream using flowchart icons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Creating a stream======&lt;br /&gt;
&lt;br /&gt;
To create a new stream group you first need to create a global “Handle” type variable to store the reference to the stream group. This is basically a unique number which used to refer to that specific group of streams in the Data Recorder. To do this, open the [[Project_Explorer|Project Explorer]] window and select the “Globals” tab. Next, under the “Variables” portion of the tree view, double-click “Add New” from the menu. In the “Create a New Variable” dialogue that pops up give the variable a meaningful name such as “DRGroupHandle”, then switch the variable type to “Object handle” and click “OK”. You should then get an Object handle variable appearing in the [[Project_Explorer|Project Explorer]] window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DRGroupHandle.png|border|150px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we need to assign the handle variable with a value by calling the Flowcode API. To do this we add a Simulation Macro (link) icon to the “Main” flowchart. Then we double-click the icon on the flowchart to edit the icon's properties. Inside the icon property window we first need to ensure that the “Functions” tab is selected and then scroll down to the “DataRecorder” section before clicking the + icon to see all the API calls related to the Data Recorder’s functionality. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderMacros.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddGroup|AddGroup]] function call creates a new named group of streams on the Data Recorder. The return value of the function call requires a handle type variable. You should set this to the name of the variable we have created previously (“DRGroupHandle” in this example). Type a name that you want into the parameter field, (such as “Test Group”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddGroup.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddStream|AddStream]] function call adds a new named stream to the group on the Data Recorder. The return value of the function call is a handle type variable. We will have to create a new global object handle type variable to store this. This handle must be unique for each single stream so you must use a new object handle variable for every program stream that you create on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddStream.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When we run the simulation the new group will be created on the Data Recorder ready for data to be streamed in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderStreamCreation.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are creating your own Flowcode component, you can move these from the Main macro to the [[Event_Components.Initialise|component initialise event]] macro so that the group and stream are created automatically when the component is added to a program. This is the way that components such as the DSP based components add their data to the console window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderEvInitialise.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that a group with no valid stream handles will not show up on the Data Recorder window, in order to avoid potential unnecessary clutter. &lt;br /&gt;
Setting the handle variable to the value of 0 using a [[Calculation_Icon_Properties|Calculation icon]] or calling the [[API_System.DeleteHandle|System -&amp;gt; DeleteHandle]] API call will remove the group or stream from the Data Recorder window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a digital pin or port to a program stream======&lt;br /&gt;
&lt;br /&gt;
A digital pin or port can be assigned to a stream object handle by using the [[API_Scope.AddPort|AddPort]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the port index where PORTA is 0, PORTB is 1 etc. &lt;br /&gt;
*the BitMask parameter. This is a binary AND mask which selects which bits of the port will be available on the stream. &lt;br /&gt;
*The PackMask parameter. Setting this to 1 will move all the active bits together if necessary. &lt;br /&gt;
*The merge parameter. This allows you to add multiple ports or pins to a single stream. Set this to 1 if you are adding a digital pin or port to an existing stream that already contains data, and you wish to combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single pin (e.g. Port A, Pin 0) with an LED connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddPort.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to toggle the LED with the signal being replicated on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderLED.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To monitor a full port (e.g. Port B) with a LED Array connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddFullPort.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then scale the stream to get the value in the range of 0-1 by calling the [[API_Scope.AddOp|AddOp]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddOp.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to generate a digital counter on Port B, with the signal being replicated on the Data Recorder. The [[API_System.ShowHandle|ShowHandle]] function allows the Data Recorder window to appear automatically without the user having to manually open the window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderLEDStrip.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding an analogue pin to a program stream======&lt;br /&gt;
&lt;br /&gt;
An analogue pin can be assigned to a stream object handle by using the [[API_Scope.AddAnalog|AddAnalog]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the analogue channel index where An0 is 0, An1 is 1 etc. &lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple analogue signals on a single stream. Set this to 1 if you are adding an analog pin to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single analogue pin (e.g. pin An0), with a potentiometer connected, we can call the [[API_Scope.AddAnalog|AddAnalog]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddAnalog.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the value of pin An0, based on the position of the potentiometer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderPotentiometer.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a custom value to a program stream======&lt;br /&gt;
&lt;br /&gt;
Custom values are those that do not correspond directly to pins or ports. A custom value can be assigned to a stream object handle by using the [[API_Scope.AddCustom|AddCustom]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the custom channel index 0-31. These act as “slots” in which to store your data. Select a value that is not used by any other custom streams.&lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple custom channels on a single stream. Set this to 1 if you are adding a custom channel to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data.&lt;br /&gt;
 &lt;br /&gt;
To create a single custom stream, we can call the [[API_Scope.AddCustom|AddCustom]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope11.jpg]] &amp;lt;!-- AddCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data for a custom channel cannot come from a digital or analogue channel automatically. Instead we have to manually pass the data to the custom channel. This is done by using the [[API_Scope.SetCustom|SetCustom]] function call. The value passed should be a floating-point real number in the range between 0 and 1 (so to convert a byte variable we would have to divide by the value 255.0.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope13.jpg]] &amp;lt;!-- SetCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program which creates a custom stream, adds custom channel 0 to it, and then continually:&lt;br /&gt;
# tracks the values of two analogue input signals&lt;br /&gt;
# calculates the average between the two readings. &lt;br /&gt;
# sends the data to custom channel 0, which appears on the Data Recorder in the created stream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope12.jpg]] &amp;lt;!-- custom program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Interacting with streams===&lt;br /&gt;
&lt;br /&gt;
You can change the time span that is being examined by using the drop down on the top-right of the window. Alternatively, you can use your mouse’s scroll wheel. Using the scroll wheel is even more powerful as it allows you to zoom directly over a particular point of interest.&lt;br /&gt;
Stream heights can be modified by dragging the bottom border of the left hand pane for the relevant stream. Colours used for rendering can be modified on the fly directly, by clicking the top square next to the stream name (for the stream background colour), and the bottom square next to the stream name (for the stream waveform/foreground colour)&lt;br /&gt;
&lt;br /&gt;
Hovering your mouse over the stream will show you the time interval between the two peaks that surround the cursor. Note that in simulation mode, this timing is not accurate.&lt;br /&gt;
&lt;br /&gt;
===Packet Decoding===&lt;br /&gt;
&lt;br /&gt;
Communications buses can be decoded to work out what values a bus is sending out and receiving. &lt;br /&gt;
&lt;br /&gt;
Supported Busses:&lt;br /&gt;
*UART (RS232, GSM, GPS, Modbus, Bluetooth, ...) &lt;br /&gt;
*SPI (SPI Master, FAT, EEPROM, RTC, ...) &lt;br /&gt;
*I2C (I2C Master, Accelerometer, EEPROM, RTC, ...) &lt;br /&gt;
&lt;br /&gt;
Packet decoding is available for certain program streams added by components. The button for decoding becomes available when the relevant communication component is added to the panel.&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decode_button.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
Decoding is then done by clicking the decode stream button on the appropriate stream. Streams can be decoded regardless of whether the Data Recorder is running in simulation or Ghost mode.&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decoded_packets.png|border|600px]]&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderPotentiometer.png&amp;diff=23464</id>
		<title>File:DataRecorderPotentiometer.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderPotentiometer.png&amp;diff=23464"/>
		<updated>2019-05-16T13:20:30Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderAddAnalog.png&amp;diff=23463</id>
		<title>File:DataRecorderAddAnalog.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderAddAnalog.png&amp;diff=23463"/>
		<updated>2019-05-16T13:20:06Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderLEDStrip.png&amp;diff=23462</id>
		<title>File:DataRecorderLEDStrip.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderLEDStrip.png&amp;diff=23462"/>
		<updated>2019-05-16T12:58:02Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderAddOp.png&amp;diff=23461</id>
		<title>File:DataRecorderAddOp.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderAddOp.png&amp;diff=23461"/>
		<updated>2019-05-16T12:57:50Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23460</id>
		<title>Using the Data Recorder</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23460"/>
		<updated>2019-05-16T12:50:13Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a Data Recorder ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside Ghost Technology to allow users to monitor signals in real time using In-Circuit-Test. It can also be used in simulation mode, though timing of signals is not accurate when using simulation. In simulation, it allows the user to see the results and values from raw data and components such as dials and measures. This data allows you to monitor the state of the various signals plotted to various channels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_recorder_wave_and_packets.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Data Recorder is very useful for analyzing data as it can accurately display information to identify patterns in the data as well as the speed data is being displayed at. Components such as the DSP range will automatically create their own Data Recorder channels, allowing for very simple yet powerful means of monitoring and debugging the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
====Adding streams====&lt;br /&gt;
&lt;br /&gt;
Streams are separated via two types: user streams and program streams. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====User streams=====&lt;br /&gt;
&lt;br /&gt;
User streams are simple streams that allow you to easily monitor the value of a digital or analog pin. They can be added by simply clicking the “Add pin trace” button on the Data Recorder itself and selecting the appropriate digital or analog pin. &lt;br /&gt;
&lt;br /&gt;
This method of adding streams is recommended if you are using [[Ghost_Technology|Ghost Technology]] to view live pin data from your Matrix hardware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_Recorder_Add_Data.png|x150px|border|Adding pins to the Data Recorder]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Program streams=====&lt;br /&gt;
&lt;br /&gt;
Program streams are added by components or by flowchart icons in your program. For some components, simply adding it to the 2d or 3d panel causes a program stream to appear in the Data Recorder. These streams are then controlled by the component itself and will be removed automatically when appropriate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SPI_Master_Streams.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we will give an example of creating your own program stream using flowchart icons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Creating a stream======&lt;br /&gt;
&lt;br /&gt;
To create a new stream group you first need to create a global “Handle” type variable to store the reference to the stream group. This is basically a unique number which used to refer to that specific group of streams in the Data Recorder. To do this, open the [[Project_Explorer|Project Explorer]] window and select the “Globals” tab. Next, under the “Variables” portion of the tree view, double-click “Add New” from the menu. In the “Create a New Variable” dialogue that pops up give the variable a meaningful name such as “DRGroupHandle”, then switch the variable type to “Object handle” and click “OK”. You should then get an Object handle variable appearing in the [[Project_Explorer|Project Explorer]] window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DRGroupHandle.png|border|150px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we need to assign the handle variable with a value by calling the Flowcode API. To do this we add a Simulation Macro (link) icon to the “Main” flowchart. Then we double-click the icon on the flowchart to edit the icon's properties. Inside the icon property window we first need to ensure that the “Functions” tab is selected and then scroll down to the “DataRecorder” section before clicking the + icon to see all the API calls related to the Data Recorder’s functionality. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderMacros.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddGroup|AddGroup]] function call creates a new named group of streams on the Data Recorder. The return value of the function call requires a handle type variable. You should set this to the name of the variable we have created previously (“DRGroupHandle” in this example). Type a name that you want into the parameter field, (such as “Test Group”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddGroup.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddStream|AddStream]] function call adds a new named stream to the group on the Data Recorder. The return value of the function call is a handle type variable. We will have to create a new global object handle type variable to store this. This handle must be unique for each single stream so you must use a new object handle variable for every program stream that you create on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddStream.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When we run the simulation the new group will be created on the Data Recorder ready for data to be streamed in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderStreamCreation.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are creating your own Flowcode component, you can move these from the Main macro to the [[Event_Components.Initialise|component initialise event]] macro so that the group and stream are created automatically when the component is added to a program. This is the way that components such as the DSP based components add their data to the console window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderEvInitialise.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that a group with no valid stream handles will not show up on the Data Recorder window, in order to avoid potential unnecessary clutter. &lt;br /&gt;
Setting the handle variable to the value of 0 using a [[Calculation_Icon_Properties|Calculation icon]] or calling the [[API_System.DeleteHandle|System -&amp;gt; DeleteHandle]] API call will remove the group or stream from the Data Recorder window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a digital pin or port to a program stream======&lt;br /&gt;
&lt;br /&gt;
A digital pin or port can be assigned to a stream object handle by using the [[API_Scope.AddPort|AddPort]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the port index where PORTA is 0, PORTB is 1 etc. &lt;br /&gt;
*the BitMask parameter. This is a binary AND mask which selects which bits of the port will be available on the stream. &lt;br /&gt;
*The PackMask parameter. Setting this to 1 will move all the active bits together if necessary. &lt;br /&gt;
*The merge parameter. This allows you to add multiple ports or pins to a single stream. Set this to 1 if you are adding a digital pin or port to an existing stream that already contains data, and you wish to combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single pin (e.g. Port A, Pin 0) with an LED connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddPort.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to toggle the LED with the signal being replicated on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderLED.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To monitor a full port (e.g. Port B) with a LED Array connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddFullPort.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then scale the stream to get the value in the range of 0-1 by calling the [[API_Scope.AddOp|AddOp]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope8.jpg]] &amp;lt;!-- AddOp call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to generate a digital counter on Port B, with the signal being replicated on the Data Recorder. The [[API_System.ShowHandle|ShowHandle]] function allows the Data Recorder window to appear automatically without the user having to manually open the window. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope14.jpg]] &amp;lt;!-- digital counter program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding an analogue pin to a program stream======&lt;br /&gt;
&lt;br /&gt;
An analogue pin can be assigned to a stream object handle by using the [[API_Scope.AddAnalog|AddAnalog]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the analogue channel index where An0 is 0, An1 is 1 etc. &lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple analogue signals on a single stream. Set this to 1 if you are adding an analog pin to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single analogue pin (e.g. pin An0), with a potentiometer connected, we can call the [[API_Scope.AddAnalog|AddAnalog]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope9.jpg]] &amp;lt;!-- AddAnalog function call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the value of pin An0, based on the position of the potentiometer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope10.jpg]] &amp;lt;!-- potentiometer program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a custom value to a program stream======&lt;br /&gt;
&lt;br /&gt;
Custom values are those that do not correspond directly to pins or ports. A custom value can be assigned to a stream object handle by using the [[API_Scope.AddCustom|AddCustom]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the custom channel index 0-31. These act as “slots” in which to store your data. Select a value that is not used by any other custom streams.&lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple custom channels on a single stream. Set this to 1 if you are adding a custom channel to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data.&lt;br /&gt;
 &lt;br /&gt;
To create a single custom stream, we can call the [[API_Scope.AddCustom|AddCustom]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope11.jpg]] &amp;lt;!-- AddCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data for a custom channel cannot come from a digital or analogue channel automatically. Instead we have to manually pass the data to the custom channel. This is done by using the [[API_Scope.SetCustom|SetCustom]] function call. The value passed should be a floating-point real number in the range between 0 and 1 (so to convert a byte variable we would have to divide by the value 255.0.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope13.jpg]] &amp;lt;!-- SetCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program which creates a custom stream, adds custom channel 0 to it, and then continually:&lt;br /&gt;
# tracks the values of two analogue input signals&lt;br /&gt;
# calculates the average between the two readings. &lt;br /&gt;
# sends the data to custom channel 0, which appears on the Data Recorder in the created stream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope12.jpg]] &amp;lt;!-- custom program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Interacting with streams===&lt;br /&gt;
&lt;br /&gt;
You can change the time span that is being examined by using the drop down on the top-right of the window. Alternatively, you can use your mouse’s scroll wheel. Using the scroll wheel is even more powerful as it allows you to zoom directly over a particular point of interest.&lt;br /&gt;
Stream heights can be modified by dragging the bottom border of the left hand pane for the relevant stream. Colours used for rendering can be modified on the fly directly, by clicking the top square next to the stream name (for the stream background colour), and the bottom square next to the stream name (for the stream waveform/foreground colour)&lt;br /&gt;
&lt;br /&gt;
Hovering your mouse over the stream will show you the time interval between the two peaks that surround the cursor. Note that in simulation mode, this timing is not accurate.&lt;br /&gt;
&lt;br /&gt;
===Packet Decoding===&lt;br /&gt;
&lt;br /&gt;
Communications buses can be decoded to work out what values a bus is sending out and receiving. &lt;br /&gt;
&lt;br /&gt;
Supported Busses:&lt;br /&gt;
*UART (RS232, GSM, GPS, Modbus, Bluetooth, ...) &lt;br /&gt;
*SPI (SPI Master, FAT, EEPROM, RTC, ...) &lt;br /&gt;
*I2C (I2C Master, Accelerometer, EEPROM, RTC, ...) &lt;br /&gt;
&lt;br /&gt;
Packet decoding is available for certain program streams added by components. The button for decoding becomes available when the relevant communication component is added to the panel.&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decode_button.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
Decoding is then done by clicking the decode stream button on the appropriate stream. Streams can be decoded regardless of whether the Data Recorder is running in simulation or Ghost mode.&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decoded_packets.png|border|600px]]&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderAddFullPort.png&amp;diff=23459</id>
		<title>File:DataRecorderAddFullPort.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderAddFullPort.png&amp;diff=23459"/>
		<updated>2019-05-16T12:49:31Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderAddPort.png&amp;diff=23458</id>
		<title>File:DataRecorderAddPort.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderAddPort.png&amp;diff=23458"/>
		<updated>2019-05-16T12:47:37Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderLED.png&amp;diff=23457</id>
		<title>File:DataRecorderLED.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderLED.png&amp;diff=23457"/>
		<updated>2019-05-16T12:45:36Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23456</id>
		<title>Using the Data Recorder</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23456"/>
		<updated>2019-05-16T12:17:26Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a Data Recorder ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside Ghost Technology to allow users to monitor signals in real time using In-Circuit-Test. It can also be used in simulation mode, though timing of signals is not accurate when using simulation. In simulation, it allows the user to see the results and values from raw data and components such as dials and measures. This data allows you to monitor the state of the various signals plotted to various channels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_recorder_wave_and_packets.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Data Recorder is very useful for analyzing data as it can accurately display information to identify patterns in the data as well as the speed data is being displayed at. Components such as the DSP range will automatically create their own Data Recorder channels, allowing for very simple yet powerful means of monitoring and debugging the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
====Adding streams====&lt;br /&gt;
&lt;br /&gt;
Streams are separated via two types: user streams and program streams. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====User streams=====&lt;br /&gt;
&lt;br /&gt;
User streams are simple streams that allow you to easily monitor the value of a digital or analog pin. They can be added by simply clicking the “Add pin trace” button on the Data Recorder itself and selecting the appropriate digital or analog pin. &lt;br /&gt;
&lt;br /&gt;
This method of adding streams is recommended if you are using [[Ghost_Technology|Ghost Technology]] to view live pin data from your Matrix hardware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_Recorder_Add_Data.png|x150px|border|Adding pins to the Data Recorder]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Program streams=====&lt;br /&gt;
&lt;br /&gt;
Program streams are added by components or by flowchart icons in your program. For some components, simply adding it to the 2d or 3d panel causes a program stream to appear in the Data Recorder. These streams are then controlled by the component itself and will be removed automatically when appropriate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SPI_Master_Streams.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we will give an example of creating your own program stream using flowchart icons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Creating a stream======&lt;br /&gt;
&lt;br /&gt;
To create a new stream group you first need to create a global “Handle” type variable to store the reference to the stream group. This is basically a unique number which used to refer to that specific group of streams in the Data Recorder. To do this, open the [[Project_Explorer|Project Explorer]] window and select the “Globals” tab. Next, under the “Variables” portion of the tree view, double-click “Add New” from the menu. In the “Create a New Variable” dialogue that pops up give the variable a meaningful name such as “DRGroupHandle”, then switch the variable type to “Object handle” and click “OK”. You should then get an Object handle variable appearing in the [[Project_Explorer|Project Explorer]] window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DRGroupHandle.png|border|150px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we need to assign the handle variable with a value by calling the Flowcode API. To do this we add a Simulation Macro (link) icon to the “Main” flowchart. Then we double-click the icon on the flowchart to edit the icon's properties. Inside the icon property window we first need to ensure that the “Functions” tab is selected and then scroll down to the “DataRecorder” section before clicking the + icon to see all the API calls related to the Data Recorder’s functionality. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderMacros.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddGroup|AddGroup]] function call creates a new named group of streams on the Data Recorder. The return value of the function call requires a handle type variable. You should set this to the name of the variable we have created previously (“DRGroupHandle” in this example). Type a name that you want into the parameter field, (such as “Test Group”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddGroup.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddStream|AddStream]] function call adds a new named stream to the group on the Data Recorder. The return value of the function call is a handle type variable. We will have to create a new global object handle type variable to store this. This handle must be unique for each single stream so you must use a new object handle variable for every program stream that you create on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddStream.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When we run the simulation the new group will be created on the Data Recorder ready for data to be streamed in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderStreamCreation.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are creating your own Flowcode component, you can move these from the Main macro to the [[Event_Components.Initialise|component initialise event]] macro so that the group and stream are created automatically when the component is added to a program. This is the way that components such as the DSP based components add their data to the console window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderEvInitialise.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that a group with no valid stream handles will not show up on the Data Recorder window, in order to avoid potential unnecessary clutter. &lt;br /&gt;
Setting the handle variable to the value of 0 using a [[Calculation_Icon_Properties|Calculation icon]] or calling the [[API_System.DeleteHandle|System -&amp;gt; DeleteHandle]] API call will remove the group or stream from the Data Recorder window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a digital pin or port to a program stream======&lt;br /&gt;
&lt;br /&gt;
A digital pin or port can be assigned to a stream object handle by using the [[API_Scope.AddPort|AddPort]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the port index where PORTA is 0, PORTB is 1 etc. &lt;br /&gt;
*the BitMask parameter. This is a binary AND mask which selects which bits of the port will be available on the stream. &lt;br /&gt;
*The PackMask parameter. Setting this to 1 will move all the active bits together if necessary. &lt;br /&gt;
*The merge parameter. This allows you to add multiple ports or pins to a single stream. Set this to 1 if you are adding a digital pin or port to an existing stream that already contains data, and you wish to combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single pin (e.g. Port A, Pin 0) with an LED connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope5.jpg]] &amp;lt;!-- AddPort call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to toggle the LED with the signal being replicated on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope6.jpg]] &amp;lt;!-- LED program with Data Recorder --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To monitor a full port (e.g. Port B)with a LED Array connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope7.jpg]] &amp;lt;!-- AddPort full port call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then scale the stream to get the value in the range of 0-1 by calling the [[API_Scope.AddOp|AddOp]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope8.jpg]] &amp;lt;!-- AddOp call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to generate a digital counter on Port B, with the signal being replicated on the Data Recorder. The [[API_System.ShowHandle|ShowHandle]] function allows the Data Recorder window to appear automatically without the user having to manually open the window. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope14.jpg]] &amp;lt;!-- digital counter program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding an analogue pin to a program stream======&lt;br /&gt;
&lt;br /&gt;
An analogue pin can be assigned to a stream object handle by using the [[API_Scope.AddAnalog|AddAnalog]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the analogue channel index where An0 is 0, An1 is 1 etc. &lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple analogue signals on a single stream. Set this to 1 if you are adding an analog pin to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single analogue pin (e.g. pin An0), with a potentiometer connected, we can call the [[API_Scope.AddAnalog|AddAnalog]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope9.jpg]] &amp;lt;!-- AddAnalog function call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the value of pin An0, based on the position of the potentiometer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope10.jpg]] &amp;lt;!-- potentiometer program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a custom value to a program stream======&lt;br /&gt;
&lt;br /&gt;
Custom values are those that do not correspond directly to pins or ports. A custom value can be assigned to a stream object handle by using the [[API_Scope.AddCustom|AddCustom]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the custom channel index 0-31. These act as “slots” in which to store your data. Select a value that is not used by any other custom streams.&lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple custom channels on a single stream. Set this to 1 if you are adding a custom channel to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data.&lt;br /&gt;
 &lt;br /&gt;
To create a single custom stream, we can call the [[API_Scope.AddCustom|AddCustom]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope11.jpg]] &amp;lt;!-- AddCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data for a custom channel cannot come from a digital or analogue channel automatically. Instead we have to manually pass the data to the custom channel. This is done by using the [[API_Scope.SetCustom|SetCustom]] function call. The value passed should be a floating-point real number in the range between 0 and 1 (so to convert a byte variable we would have to divide by the value 255.0.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope13.jpg]] &amp;lt;!-- SetCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program which creates a custom stream, adds custom channel 0 to it, and then continually:&lt;br /&gt;
# tracks the values of two analogue input signals&lt;br /&gt;
# calculates the average between the two readings. &lt;br /&gt;
# sends the data to custom channel 0, which appears on the Data Recorder in the created stream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope12.jpg]] &amp;lt;!-- custom program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Interacting with streams===&lt;br /&gt;
&lt;br /&gt;
You can change the time span that is being examined by using the drop down on the top-right of the window. Alternatively, you can use your mouse’s scroll wheel. Using the scroll wheel is even more powerful as it allows you to zoom directly over a particular point of interest.&lt;br /&gt;
Stream heights can be modified by dragging the bottom border of the left hand pane for the relevant stream. Colours used for rendering can be modified on the fly directly, by clicking the top square next to the stream name (for the stream background colour), and the bottom square next to the stream name (for the stream waveform/foreground colour)&lt;br /&gt;
&lt;br /&gt;
Hovering your mouse over the stream will show you the time interval between the two peaks that surround the cursor. Note that in simulation mode, this timing is not accurate.&lt;br /&gt;
&lt;br /&gt;
===Packet Decoding===&lt;br /&gt;
&lt;br /&gt;
Communications buses can be decoded to work out what values a bus is sending out and receiving. &lt;br /&gt;
&lt;br /&gt;
Supported Busses:&lt;br /&gt;
*UART (RS232, GSM, GPS, Modbus, Bluetooth, ...) &lt;br /&gt;
*SPI (SPI Master, FAT, EEPROM, RTC, ...) &lt;br /&gt;
*I2C (I2C Master, Accelerometer, EEPROM, RTC, ...) &lt;br /&gt;
&lt;br /&gt;
Packet decoding is available for certain program streams added by components. The button for decoding becomes available when the relevant communication component is added to the panel.&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decode_button.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
Decoding is then done by clicking the decode stream button on the appropriate stream. Streams can be decoded regardless of whether the Data Recorder is running in simulation or Ghost mode.&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decoded_packets.png|border|600px]]&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderEvInitialise.png&amp;diff=23455</id>
		<title>File:DataRecorderEvInitialise.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderEvInitialise.png&amp;diff=23455"/>
		<updated>2019-05-16T12:16:31Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderStreamCreation.png&amp;diff=23454</id>
		<title>File:DataRecorderStreamCreation.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderStreamCreation.png&amp;diff=23454"/>
		<updated>2019-05-16T12:12:19Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23453</id>
		<title>Using the Data Recorder</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23453"/>
		<updated>2019-05-16T12:09:22Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a Data Recorder ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside Ghost Technology to allow users to monitor signals in real time using In-Circuit-Test. It can also be used in simulation mode, though timing of signals is not accurate when using simulation. In simulation, it allows the user to see the results and values from raw data and components such as dials and measures. This data allows you to monitor the state of the various signals plotted to various channels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_recorder_wave_and_packets.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Data Recorder is very useful for analyzing data as it can accurately display information to identify patterns in the data as well as the speed data is being displayed at. Components such as the DSP range will automatically create their own Data Recorder channels, allowing for very simple yet powerful means of monitoring and debugging the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
====Adding streams====&lt;br /&gt;
&lt;br /&gt;
Streams are separated via two types: user streams and program streams. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====User streams=====&lt;br /&gt;
&lt;br /&gt;
User streams are simple streams that allow you to easily monitor the value of a digital or analog pin. They can be added by simply clicking the “Add pin trace” button on the Data Recorder itself and selecting the appropriate digital or analog pin. &lt;br /&gt;
&lt;br /&gt;
This method of adding streams is recommended if you are using [[Ghost_Technology|Ghost Technology]] to view live pin data from your Matrix hardware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_Recorder_Add_Data.png|x150px|border|Adding pins to the Data Recorder]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Program streams=====&lt;br /&gt;
&lt;br /&gt;
Program streams are added by components or by flowchart icons in your program. For some components, simply adding it to the 2d or 3d panel causes a program stream to appear in the Data Recorder. These streams are then controlled by the component itself and will be removed automatically when appropriate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SPI_Master_Streams.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we will give an example of creating your own program stream using flowchart icons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Creating a stream======&lt;br /&gt;
&lt;br /&gt;
To create a new stream group you first need to create a global “Handle” type variable to store the reference to the stream group. This is basically a unique number which used to refer to that specific group of streams in the Data Recorder. To do this, open the [[Project_Explorer|Project Explorer]] window and select the “Globals” tab. Next, under the “Variables” portion of the tree view, double-click “Add New” from the menu. In the “Create a New Variable” dialogue that pops up give the variable a meaningful name such as “DRGroupHandle”, then switch the variable type to “Object handle” and click “OK”. You should then get an Object handle variable appearing in the [[Project_Explorer|Project Explorer]] window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DRGroupHandle.png|border|150px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we need to assign the handle variable with a value by calling the Flowcode API. To do this we add a Simulation Macro (link) icon to the “Main” flowchart. Then we double-click the icon on the flowchart to edit the icon's properties. Inside the icon property window we first need to ensure that the “Functions” tab is selected and then scroll down to the “DataRecorder” section before clicking the + icon to see all the API calls related to the Data Recorder’s functionality. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderMacros.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddGroup|AddGroup]] function call creates a new named group of streams on the Data Recorder. The return value of the function call requires a handle type variable. You should set this to the name of the variable we have created previously (“DRGroupHandle” in this example). Type a name that you want into the parameter field, (such as “Test Group”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddGroup.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddStream|AddStream]] function call adds a new named stream to the group on the Data Recorder. The return value of the function call is a handle type variable. We will have to create a new global object handle type variable to store this. This handle must be unique for each single stream so you must use a new object handle variable for every program stream that you create on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DataRecorderAddStream.png|border|200px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When we run the simulation the new group will be created on the Data Recorder ready for data to be streamed in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3.jpg]] &amp;lt;!-- flow icons and created stream image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are creating your own Flowcode component, you can move these from the Main macro to the [[Event_Components.Initialise|simulation initialise event]] macro so that the group and stream are created automatically when the component is added to a program. This is the way that components such as the DSP based components add their data to the console window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope4.jpg]] &amp;lt;!-- Ev_initialise image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a group with no valid stream handles will not show up on the Data Recorder window just to try and avoid potential unnecessary clutter. &lt;br /&gt;
Setting the handle variable to the value of 0 using a [[Calculation_Icon_Properties|Calculation icon]] or calling the [[API_System.DeleteHandle|System -&amp;gt; DeleteHandle]] API call will remove the group or stream from the Data Recorder window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a digital pin or port to a program stream======&lt;br /&gt;
&lt;br /&gt;
A digital pin or port can be assigned to a stream object handle by using the [[API_Scope.AddPort|AddPort]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the port index where PORTA is 0, PORTB is 1 etc. &lt;br /&gt;
*the BitMask parameter. This is a binary AND mask which selects which bits of the port will be available on the stream. &lt;br /&gt;
*The PackMask parameter. Setting this to 1 will move all the active bits together if necessary. &lt;br /&gt;
*The merge parameter. This allows you to add multiple ports or pins to a single stream. Set this to 1 if you are adding a digital pin or port to an existing stream that already contains data, and you wish to combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single pin (e.g. Port A, Pin 0) with an LED connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope5.jpg]] &amp;lt;!-- AddPort call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to toggle the LED with the signal being replicated on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope6.jpg]] &amp;lt;!-- LED program with Data Recorder --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To monitor a full port (e.g. Port B)with a LED Array connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope7.jpg]] &amp;lt;!-- AddPort full port call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then scale the stream to get the value in the range of 0-1 by calling the [[API_Scope.AddOp|AddOp]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope8.jpg]] &amp;lt;!-- AddOp call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to generate a digital counter on Port B, with the signal being replicated on the Data Recorder. The [[API_System.ShowHandle|ShowHandle]] function allows the Data Recorder window to appear automatically without the user having to manually open the window. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope14.jpg]] &amp;lt;!-- digital counter program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding an analogue pin to a program stream======&lt;br /&gt;
&lt;br /&gt;
An analogue pin can be assigned to a stream object handle by using the [[API_Scope.AddAnalog|AddAnalog]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the analogue channel index where An0 is 0, An1 is 1 etc. &lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple analogue signals on a single stream. Set this to 1 if you are adding an analog pin to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single analogue pin (e.g. pin An0), with a potentiometer connected, we can call the [[API_Scope.AddAnalog|AddAnalog]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope9.jpg]] &amp;lt;!-- AddAnalog function call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the value of pin An0, based on the position of the potentiometer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope10.jpg]] &amp;lt;!-- potentiometer program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a custom value to a program stream======&lt;br /&gt;
&lt;br /&gt;
Custom values are those that do not correspond directly to pins or ports. A custom value can be assigned to a stream object handle by using the [[API_Scope.AddCustom|AddCustom]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the custom channel index 0-31. These act as “slots” in which to store your data. Select a value that is not used by any other custom streams.&lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple custom channels on a single stream. Set this to 1 if you are adding a custom channel to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data.&lt;br /&gt;
 &lt;br /&gt;
To create a single custom stream, we can call the [[API_Scope.AddCustom|AddCustom]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope11.jpg]] &amp;lt;!-- AddCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data for a custom channel cannot come from a digital or analogue channel automatically. Instead we have to manually pass the data to the custom channel. This is done by using the [[API_Scope.SetCustom|SetCustom]] function call. The value passed should be a floating-point real number in the range between 0 and 1 (so to convert a byte variable we would have to divide by the value 255.0.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope13.jpg]] &amp;lt;!-- SetCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program which creates a custom stream, adds custom channel 0 to it, and then continually:&lt;br /&gt;
# tracks the values of two analogue input signals&lt;br /&gt;
# calculates the average between the two readings. &lt;br /&gt;
# sends the data to custom channel 0, which appears on the Data Recorder in the created stream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope12.jpg]] &amp;lt;!-- custom program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Interacting with streams===&lt;br /&gt;
&lt;br /&gt;
You can change the time span that is being examined by using the drop down on the top-right of the window. Alternatively, you can use your mouse’s scroll wheel. Using the scroll wheel is even more powerful as it allows you to zoom directly over a particular point of interest.&lt;br /&gt;
Stream heights can be modified by dragging the bottom border of the left hand pane for the relevant stream. Colours used for rendering can be modified on the fly directly, by clicking the top square next to the stream name (for the stream background colour), and the bottom square next to the stream name (for the stream waveform/foreground colour)&lt;br /&gt;
&lt;br /&gt;
Hovering your mouse over the stream will show you the time interval between the two peaks that surround the cursor. Note that in simulation mode, this timing is not accurate.&lt;br /&gt;
&lt;br /&gt;
===Packet Decoding===&lt;br /&gt;
&lt;br /&gt;
Communications buses can be decoded to work out what values a bus is sending out and receiving. &lt;br /&gt;
&lt;br /&gt;
Supported Busses:&lt;br /&gt;
*UART (RS232, GSM, GPS, Modbus, Bluetooth, ...) &lt;br /&gt;
*SPI (SPI Master, FAT, EEPROM, RTC, ...) &lt;br /&gt;
*I2C (I2C Master, Accelerometer, EEPROM, RTC, ...) &lt;br /&gt;
&lt;br /&gt;
Packet decoding is available for certain program streams added by components. The button for decoding becomes available when the relevant communication component is added to the panel.&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decode_button.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
Decoding is then done by clicking the decode stream button on the appropriate stream. Streams can be decoded regardless of whether the Data Recorder is running in simulation or Ghost mode.&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decoded_packets.png|border|600px]]&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderAddStream.png&amp;diff=23452</id>
		<title>File:DataRecorderAddStream.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderAddStream.png&amp;diff=23452"/>
		<updated>2019-05-16T12:06:13Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderAddGroup.png&amp;diff=23451</id>
		<title>File:DataRecorderAddGroup.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderAddGroup.png&amp;diff=23451"/>
		<updated>2019-05-16T12:06:03Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderMacros.png&amp;diff=23450</id>
		<title>File:DataRecorderMacros.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:DataRecorderMacros.png&amp;diff=23450"/>
		<updated>2019-05-16T12:05:52Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:DRGroupHandle.png&amp;diff=23449</id>
		<title>File:DRGroupHandle.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:DRGroupHandle.png&amp;diff=23449"/>
		<updated>2019-05-16T12:05:34Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23448</id>
		<title>Using the Data Recorder</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23448"/>
		<updated>2019-05-16T10:28:55Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a Data Recorder ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside Ghost Technology to allow users to monitor signals in real time using In-Circuit-Test. It can also be used in simulation mode, though timing of signals is not accurate when using simulation. In simulation, it allows the user to see the results and values from raw data and components such as dials and measures. This data allows you to monitor the state of the various signals plotted to various channels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_recorder_wave_and_packets.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Data Recorder is very useful for analyzing data as it can accurately display information to identify patterns in the data as well as the speed data is being displayed at. Components such as the DSP range will automatically create their own Data Recorder channels, allowing for very simple yet powerful means of monitoring and debugging the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
====Adding streams====&lt;br /&gt;
&lt;br /&gt;
Streams are separated via two types: user streams and program streams. &lt;br /&gt;
&lt;br /&gt;
=====User streams=====&lt;br /&gt;
&lt;br /&gt;
User streams are simple streams that allow you to easily monitor the value of a digital or analog pin. They can be added by simply clicking the “Add pin trace” button on the Data Recorder itself and selecting the appropriate digital or analog pin. &lt;br /&gt;
&lt;br /&gt;
This method of adding streams is recommended if you are using [[Ghost_Technology|Ghost Technology]] to view live pin data from your Matrix hardware.&lt;br /&gt;
&lt;br /&gt;
[[File:Data_Recorder_Add_Data.png|x150px|border|Adding pins to the Data Recorder]]&lt;br /&gt;
&lt;br /&gt;
=====Program streams=====&lt;br /&gt;
&lt;br /&gt;
Program streams are added by components or by flowchart icons in your program. For some components, simply adding it to the 2d or 3d panel causes a program stream to appear in the Data Recorder. These streams are then controlled by the component itself and will be removed automatically when appropriate.&lt;br /&gt;
&lt;br /&gt;
[[File:SPI_Master_Streams.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we will give an example of creating your own program stream using flowchart icons.&lt;br /&gt;
&lt;br /&gt;
======Creating a stream group======&lt;br /&gt;
&lt;br /&gt;
To create a new stream group you first need to create a global “Handle” type variable to store the reference to the stream group. This is basically a unique number which used to refer to that specific group of streams in the Data Recorder. To do this, open the [[Project_Explorer|Project Explorer]] window and select the “Globals” tab. Next, right click the “Variables” portion of the tree view and select “Add New” from the menu. In the “Create a New Variable” dialogue that pops up give the variable a meaningful name such as “DRGroupHandle”, then switch the variable type to “Object handle” and click “OK”. You should then get an Object handle variable appearing in the [[Project_Explorer|Project Explorer]] window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope1.jpg]] &amp;lt;!--Created handle variable called DRGroupHandle--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we need to assign the handle variable with a value by calling the Flowcode API. To do this we add a Simulation Macro (link) icon to the “Main” flowchart. Then we double-click the icon on the flowchart to edit the icon's properties. Inside the icon property window we first need to ensure that the “Functions” tab is selected and then scroll down to the “DataRecorder” section before clicking the + icon to see all the API calls related to the Data Recorder’s functionality. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope2.jpg]] &amp;lt;!-- List of DataRecorder API functions --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddGroup|AddGroup]] function call creates a new named group of streams on the Data Recorder. The return value of the function call requires a handle type variable. You should set this to the name of the variable we have created previously (“DRGroupHandle” in this example). Type a name that you want into the parameter field, (such as “Test Group”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3A.jpg]] &amp;lt;!-- Image of AddGroup with variable entered and “Test Group” --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddStream|AddStream]] function call adds a new named stream to the group on the Data Recorder. The return value of the function call is a handle type variable. We will have to create a new global object handle type variable to store this. This handle must be unique for each single stream so you must use a new object handle variable for every program stream that you create on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope3B.jpg]] &amp;lt;!-- Image of AddStream with DRGroupHandle, DRStreamHandle return --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we run the simulation the new group will be created on the Data Recorder ready for data to be streamed in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3.jpg]] &amp;lt;!-- flow icons and created stream image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are creating your own Flowcode component, you can move these from the Main macro to the [[Event_Components.Initialise|simulation initialise event]] macro so that the group and stream are created automatically when the component is added to a program. This is the way that components such as the DSP based components add their data to the console window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope4.jpg]] &amp;lt;!-- Ev_initialise image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a group with no valid stream handles will not show up on the Data Recorder window just to try and avoid potential unnecessary clutter. &lt;br /&gt;
Setting the handle variable to the value of 0 using a [[Calculation_Icon_Properties|Calculation icon]] or calling the [[API_System.DeleteHandle|System -&amp;gt; DeleteHandle]] API call will remove the group or stream from the Data Recorder window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a digital pin or port to a program stream======&lt;br /&gt;
&lt;br /&gt;
A digital pin or port can be assigned to a stream object handle by using the [[API_Scope.AddPort|AddPort]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the port index where PORTA is 0, PORTB is 1 etc. &lt;br /&gt;
*the BitMask parameter. This is a binary AND mask which selects which bits of the port will be available on the stream. &lt;br /&gt;
*The PackMask parameter. Setting this to 1 will move all the active bits together if necessary. &lt;br /&gt;
*The merge parameter. This allows you to add multiple ports or pins to a single stream. Set this to 1 if you are adding a digital pin or port to an existing stream that already contains data, and you wish to combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single pin (e.g. Port A, Pin 0) with an LED connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope5.jpg]] &amp;lt;!-- AddPort call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to toggle the LED with the signal being replicated on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope6.jpg]] &amp;lt;!-- LED program with Data Recorder --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To monitor a full port (e.g. Port B)with a LED Array connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope7.jpg]] &amp;lt;!-- AddPort full port call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then scale the stream to get the value in the range of 0-1 by calling the [[API_Scope.AddOp|AddOp]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope8.jpg]] &amp;lt;!-- AddOp call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to generate a digital counter on Port B, with the signal being replicated on the Data Recorder. The [[API_System.ShowHandle|ShowHandle]] function allows the Data Recorder window to appear automatically without the user having to manually open the window. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope14.jpg]] &amp;lt;!-- digital counter program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding an analogue pin to a program stream======&lt;br /&gt;
&lt;br /&gt;
An analogue pin can be assigned to a stream object handle by using the [[API_Scope.AddAnalog|AddAnalog]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the analogue channel index where An0 is 0, An1 is 1 etc. &lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple analogue signals on a single stream. Set this to 1 if you are adding an analog pin to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single analogue pin (e.g. pin An0), with a potentiometer connected, we can call the [[API_Scope.AddAnalog|AddAnalog]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope9.jpg]] &amp;lt;!-- AddAnalog function call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the value of pin An0, based on the position of the potentiometer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope10.jpg]] &amp;lt;!-- potentiometer program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a custom value to a program stream======&lt;br /&gt;
&lt;br /&gt;
Custom values are those that do not correspond directly to pins or ports. A custom value can be assigned to a stream object handle by using the [[API_Scope.AddCustom|AddCustom]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the custom channel index 0-31. These act as “slots” in which to store your data. Select a value that is not used by any other custom streams.&lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple custom channels on a single stream. Set this to 1 if you are adding a custom channel to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data.&lt;br /&gt;
 &lt;br /&gt;
To create a single custom stream, we can call the [[API_Scope.AddCustom|AddCustom]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope11.jpg]] &amp;lt;!-- AddCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data for a custom channel cannot come from a digital or analogue channel automatically. Instead we have to manually pass the data to the custom channel. This is done by using the [[API_Scope.SetCustom|SetCustom]] function call. The value passed should be a floating-point real number in the range between 0 and 1 (so to convert a byte variable we would have to divide by the value 255.0.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope13.jpg]] &amp;lt;!-- SetCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program which creates a custom stream, adds custom channel 0 to it, and then continually:&lt;br /&gt;
# tracks the values of two analogue input signals&lt;br /&gt;
# calculates the average between the two readings. &lt;br /&gt;
# sends the data to custom channel 0, which appears on the Data Recorder in the created stream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope12.jpg]] &amp;lt;!-- custom program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Interacting with streams===&lt;br /&gt;
&lt;br /&gt;
You can change the time span that is being examined by using the drop down on the top-right of the window. Alternatively, you can use your mouse’s scroll wheel. Using the scroll wheel is even more powerful as it allows you to zoom directly over a particular point of interest.&lt;br /&gt;
Stream heights can be modified by dragging the bottom border of the left hand pane for the relevant stream. Colours used for rendering can be modified on the fly directly, by clicking the top square next to the stream name (for the stream background colour), and the bottom square next to the stream name (for the stream waveform/foreground colour)&lt;br /&gt;
&lt;br /&gt;
Hovering your mouse over the stream will show you the time interval between the two peaks that surround the cursor. Note that in simulation mode, this timing is not accurate.&lt;br /&gt;
&lt;br /&gt;
===Packet Decoding===&lt;br /&gt;
&lt;br /&gt;
Communications buses can be decoded to work out what values a bus is sending out and receiving. &lt;br /&gt;
&lt;br /&gt;
Supported Busses:&lt;br /&gt;
*UART (RS232, GSM, GPS, Modbus, Bluetooth, ...) &lt;br /&gt;
*SPI (SPI Master, FAT, EEPROM, RTC, ...) &lt;br /&gt;
*I2C (I2C Master, Accelerometer, EEPROM, RTC, ...) &lt;br /&gt;
&lt;br /&gt;
Packet decoding is available for certain program streams added by components. The button for decoding becomes available when the relevant communication component is added to the panel.&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decode_button.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
Decoding is then done by clicking the decode stream button on the appropriate stream. Streams can be decoded regardless of whether the Data Recorder is running in simulation or Ghost mode.&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decoded_packets.png|border|600px]]&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:SPI_Master_Streams.png&amp;diff=23447</id>
		<title>File:SPI Master Streams.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:SPI_Master_Streams.png&amp;diff=23447"/>
		<updated>2019-05-16T10:28:29Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23446</id>
		<title>Using the Data Recorder</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23446"/>
		<updated>2019-05-16T10:19:42Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a Data Recorder ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside Ghost Technology to allow users to monitor signals in real time using In-Circuit-Test. It can also be used in simulation mode, though timing of signals is not accurate when using simulation. In simulation, it allows the user to see the results and values from raw data and components such as dials and measures. This data allows you to monitor the state of the various signals plotted to various channels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_recorder_wave_and_packets.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Data Recorder is very useful for analyzing data as it can accurately display information to identify patterns in the data as well as the speed data is being displayed at. Components such as the DSP range will automatically create their own Data Recorder channels, allowing for very simple yet powerful means of monitoring and debugging the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
====Adding streams====&lt;br /&gt;
&lt;br /&gt;
Streams are separated via two types: user streams and program streams. &lt;br /&gt;
&lt;br /&gt;
=====User streams=====&lt;br /&gt;
&lt;br /&gt;
User streams are simple streams that allow you to easily monitor the value of a digital or analog pin. They can be added by simply clicking the “Add pin trace” button on the Data Recorder itself and selecting the appropriate digital or analog pin. &lt;br /&gt;
&lt;br /&gt;
This method of adding streams is recommended if you are using [[Ghost_Technology|Ghost Technology]] to view live pin data from your Matrix hardware.&lt;br /&gt;
&lt;br /&gt;
[[File:Data_Recorder_Add_Data.png|x150px|border|Adding pins to the Data Recorder]]&lt;br /&gt;
&lt;br /&gt;
=====Program streams=====&lt;br /&gt;
&lt;br /&gt;
Program streams are added by components or by flowchart icons in your program. For some components, simply adding it to the 2d or 3d panel causes a program stream to appear in the Data Recorder. These streams are then controlled by the component itself and will be removed automatically when appropriate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Image of program streams added by SPI master.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we will give an example of creating your own program stream using flowchart icons.&lt;br /&gt;
&lt;br /&gt;
======Creating a stream group======&lt;br /&gt;
&lt;br /&gt;
To create a new stream group you first need to create a global “Handle” type variable to store the reference to the stream group. This is basically a unique number which used to refer to that specific group of streams in the Data Recorder. To do this, open the [[Project_Explorer|Project Explorer]] window and select the “Globals” tab. Next, right click the “Variables” portion of the tree view and select “Add New” from the menu. In the “Create a New Variable” dialogue that pops up give the variable a meaningful name such as “DRGroupHandle”, then switch the variable type to “Object handle” and click “OK”. You should then get an Object handle variable appearing in the [[Project_Explorer|Project Explorer]] window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope1.jpg]] &amp;lt;!--Created handle variable called DRGroupHandle--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we need to assign the handle variable with a value by calling the Flowcode API. To do this we add a Simulation Macro (link) icon to the “Main” flowchart. Then we double-click the icon on the flowchart to edit the icon's properties. Inside the icon property window we first need to ensure that the “Functions” tab is selected and then scroll down to the “DataRecorder” section before clicking the + icon to see all the API calls related to the Data Recorder’s functionality. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope2.jpg]] &amp;lt;!-- List of DataRecorder API functions --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddGroup|AddGroup]] function call creates a new named group of streams on the Data Recorder. The return value of the function call requires a handle type variable. You should set this to the name of the variable we have created previously (“DRGroupHandle” in this example). Type a name that you want into the parameter field, (such as “Test Group”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3A.jpg]] &amp;lt;!-- Image of AddGroup with variable entered and “Test Group” --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddStream|AddStream]] function call adds a new named stream to the group on the Data Recorder. The return value of the function call is a handle type variable. We will have to create a new global object handle type variable to store this. This handle must be unique for each single stream so you must use a new object handle variable for every program stream that you create on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope3B.jpg]] &amp;lt;!-- Image of AddStream with DRGroupHandle, DRStreamHandle return --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we run the simulation the new group will be created on the Data Recorder ready for data to be streamed in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3.jpg]] &amp;lt;!-- flow icons and created stream image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are creating your own Flowcode component, you can move these from the Main macro to the [[Event_Components.Initialise|simulation initialise event]] macro so that the group and stream are created automatically when the component is added to a program. This is the way that components such as the DSP based components add their data to the console window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope4.jpg]] &amp;lt;!-- Ev_initialise image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a group with no valid stream handles will not show up on the Data Recorder window just to try and avoid potential unnecessary clutter. &lt;br /&gt;
Setting the handle variable to the value of 0 using a [[Calculation_Icon_Properties|Calculation icon]] or calling the [[API_System.DeleteHandle|System -&amp;gt; DeleteHandle]] API call will remove the group or stream from the Data Recorder window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a digital pin or port to a program stream======&lt;br /&gt;
&lt;br /&gt;
A digital pin or port can be assigned to a stream object handle by using the [[API_Scope.AddPort|AddPort]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the port index where PORTA is 0, PORTB is 1 etc. &lt;br /&gt;
*the BitMask parameter. This is a binary AND mask which selects which bits of the port will be available on the stream. &lt;br /&gt;
*The PackMask parameter. Setting this to 1 will move all the active bits together if necessary. &lt;br /&gt;
*The merge parameter. This allows you to add multiple ports or pins to a single stream. Set this to 1 if you are adding a digital pin or port to an existing stream that already contains data, and you wish to combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single pin (e.g. Port A, Pin 0) with an LED connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope5.jpg]] &amp;lt;!-- AddPort call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to toggle the LED with the signal being replicated on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope6.jpg]] &amp;lt;!-- LED program with Data Recorder --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To monitor a full port (e.g. Port B)with a LED Array connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope7.jpg]] &amp;lt;!-- AddPort full port call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then scale the stream to get the value in the range of 0-1 by calling the [[API_Scope.AddOp|AddOp]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope8.jpg]] &amp;lt;!-- AddOp call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to generate a digital counter on Port B, with the signal being replicated on the Data Recorder. The [[API_System.ShowHandle|ShowHandle]] function allows the Data Recorder window to appear automatically without the user having to manually open the window. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope14.jpg]] &amp;lt;!-- digital counter program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding an analogue pin to a program stream======&lt;br /&gt;
&lt;br /&gt;
An analogue pin can be assigned to a stream object handle by using the [[API_Scope.AddAnalog|AddAnalog]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the analogue channel index where An0 is 0, An1 is 1 etc. &lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple analogue signals on a single stream. Set this to 1 if you are adding an analog pin to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single analogue pin (e.g. pin An0), with a potentiometer connected, we can call the [[API_Scope.AddAnalog|AddAnalog]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope9.jpg]] &amp;lt;!-- AddAnalog function call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the value of pin An0, based on the position of the potentiometer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope10.jpg]] &amp;lt;!-- potentiometer program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a custom value to a program stream======&lt;br /&gt;
&lt;br /&gt;
Custom values are those that do not correspond directly to pins or ports. A custom value can be assigned to a stream object handle by using the [[API_Scope.AddCustom|AddCustom]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the custom channel index 0-31. These act as “slots” in which to store your data. Select a value that is not used by any other custom streams.&lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple custom channels on a single stream. Set this to 1 if you are adding a custom channel to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data.&lt;br /&gt;
 &lt;br /&gt;
To create a single custom stream, we can call the [[API_Scope.AddCustom|AddCustom]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope11.jpg]] &amp;lt;!-- AddCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data for a custom channel cannot come from a digital or analogue channel automatically. Instead we have to manually pass the data to the custom channel. This is done by using the [[API_Scope.SetCustom|SetCustom]] function call. The value passed should be a floating-point real number in the range between 0 and 1 (so to convert a byte variable we would have to divide by the value 255.0.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope13.jpg]] &amp;lt;!-- SetCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program which creates a custom stream, adds custom channel 0 to it, and then continually:&lt;br /&gt;
# tracks the values of two analogue input signals&lt;br /&gt;
# calculates the average between the two readings. &lt;br /&gt;
# sends the data to custom channel 0, which appears on the Data Recorder in the created stream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope12.jpg]] &amp;lt;!-- custom program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Interacting with streams===&lt;br /&gt;
&lt;br /&gt;
You can change the time span that is being examined by using the drop down on the top-right of the window. Alternatively, you can use your mouse’s scroll wheel. Using the scroll wheel is even more powerful as it allows you to zoom directly over a particular point of interest.&lt;br /&gt;
Stream heights can be modified by dragging the bottom border of the left hand pane for the relevant stream. Colours used for rendering can be modified on the fly directly, by clicking the top square next to the stream name (for the stream background colour), and the bottom square next to the stream name (for the stream waveform/foreground colour)&lt;br /&gt;
&lt;br /&gt;
Hovering your mouse over the stream will show you the time interval between the two peaks that surround the cursor. Note that in simulation mode, this timing is not accurate.&lt;br /&gt;
&lt;br /&gt;
===Packet Decoding===&lt;br /&gt;
&lt;br /&gt;
Communications buses can be decoded to work out what values a bus is sending out and receiving. &lt;br /&gt;
&lt;br /&gt;
Supported Busses:&lt;br /&gt;
*UART (RS232, GSM, GPS, Modbus, Bluetooth, ...) &lt;br /&gt;
*SPI (SPI Master, FAT, EEPROM, RTC, ...) &lt;br /&gt;
*I2C (I2C Master, Accelerometer, EEPROM, RTC, ...) &lt;br /&gt;
&lt;br /&gt;
Packet decoding is available for certain program streams added by components. The button for decoding becomes available when the relevant communication component is added to the panel.&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decode_button.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
Decoding is then done by clicking the decode stream button on the appropriate stream. Streams can be decoded regardless of whether the Data Recorder is running in simulation or Ghost mode.&lt;br /&gt;
&lt;br /&gt;
[[File:data_recorder_decoded_packets.png|border|600px]]&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:Data_recorder_decoded_packets.png&amp;diff=23445</id>
		<title>File:Data recorder decoded packets.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:Data_recorder_decoded_packets.png&amp;diff=23445"/>
		<updated>2019-05-16T10:17:09Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:Data_recorder_decode_button.png&amp;diff=23444</id>
		<title>File:Data recorder decode button.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:Data_recorder_decode_button.png&amp;diff=23444"/>
		<updated>2019-05-16T10:16:52Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23443</id>
		<title>Using the Data Recorder</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23443"/>
		<updated>2019-05-16T10:04:37Z</updated>

		<summary type="html">&lt;p&gt;DanielM: /* User streams */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a Data Recorder ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside Ghost Technology to allow users to monitor signals in real time using In-Circuit-Test. It can also be used in simulation mode, though timing of signals is not accurate when using simulation. In simulation, it allows the user to see the results and values from raw data and components such as dials and measures. This data allows you to monitor the state of the various signals plotted to various channels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_recorder_wave_and_packets.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Data Recorder is very useful for analyzing data as it can accurately display information to identify patterns in the data as well as the speed data is being displayed at. Components such as the DSP range will automatically create their own Data Recorder channels, allowing for very simple yet powerful means of monitoring and debugging the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
====Adding streams====&lt;br /&gt;
&lt;br /&gt;
Streams are separated via two types: user streams and program streams. &lt;br /&gt;
&lt;br /&gt;
=====User streams=====&lt;br /&gt;
&lt;br /&gt;
User streams are simple streams that allow you to easily monitor the value of a digital or analog pin. They can be added by simply clicking the “Add pin trace” button on the Data Recorder itself and selecting the appropriate digital or analog pin. &lt;br /&gt;
&lt;br /&gt;
This method of adding streams is recommended if you are using [[Ghost_Technology|Ghost Technology]] to view live pin data from your Matrix hardware.&lt;br /&gt;
&lt;br /&gt;
[[File:Data_Recorder_Add_Data.png|x150px|border|Adding pins to the Data Recorder]]&lt;br /&gt;
&lt;br /&gt;
=====Program streams=====&lt;br /&gt;
&lt;br /&gt;
Program streams are added by components or by flowchart icons in your program. For some components, simply adding it to the 2d or 3d panel causes a program stream to appear in the Data Recorder. These streams are then controlled by the component itself and will be removed automatically when appropriate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Image of program streams added by SPI master.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we will give an example of creating your own program stream using flowchart icons.&lt;br /&gt;
&lt;br /&gt;
======Creating a stream group======&lt;br /&gt;
&lt;br /&gt;
To create a new stream group you first need to create a global “Handle” type variable to store the reference to the stream group. This is basically a unique number which used to refer to that specific group of streams in the Data Recorder. To do this, open the [[Project_Explorer|Project Explorer]] window and select the “Globals” tab. Next, right click the “Variables” portion of the tree view and select “Add New” from the menu. In the “Create a New Variable” dialogue that pops up give the variable a meaningful name such as “DRGroupHandle”, then switch the variable type to “Object handle” and click “OK”. You should then get an Object handle variable appearing in the [[Project_Explorer|Project Explorer]] window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope1.jpg]] &amp;lt;!--Created handle variable called DRGroupHandle--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we need to assign the handle variable with a value by calling the Flowcode API. To do this we add a Simulation Macro (link) icon to the “Main” flowchart. Then we double-click the icon on the flowchart to edit the icon's properties. Inside the icon property window we first need to ensure that the “Functions” tab is selected and then scroll down to the “DataRecorder” section before clicking the + icon to see all the API calls related to the Data Recorder’s functionality. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope2.jpg]] &amp;lt;!-- List of DataRecorder API functions --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddGroup|AddGroup]] function call creates a new named group of streams on the Data Recorder. The return value of the function call requires a handle type variable. You should set this to the name of the variable we have created previously (“DRGroupHandle” in this example). Type a name that you want into the parameter field, (such as “Test Group”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3A.jpg]] &amp;lt;!-- Image of AddGroup with variable entered and “Test Group” --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddStream|AddStream]] function call adds a new named stream to the group on the Data Recorder. The return value of the function call is a handle type variable. We will have to create a new global object handle type variable to store this. This handle must be unique for each single stream so you must use a new object handle variable for every program stream that you create on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope3B.jpg]] &amp;lt;!-- Image of AddStream with DRGroupHandle, DRStreamHandle return --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we run the simulation the new group will be created on the Data Recorder ready for data to be streamed in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3.jpg]] &amp;lt;!-- flow icons and created stream image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are creating your own Flowcode component, you can move these from the Main macro to the [[Event_Components.Initialise|simulation initialise event]] macro so that the group and stream are created automatically when the component is added to a program. This is the way that components such as the DSP based components add their data to the console window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope4.jpg]] &amp;lt;!-- Ev_initialise image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a group with no valid stream handles will not show up on the Data Recorder window just to try and avoid potential unnecessary clutter. &lt;br /&gt;
Setting the handle variable to the value of 0 using a [[Calculation_Icon_Properties|Calculation icon]] or calling the [[API_System.DeleteHandle|System -&amp;gt; DeleteHandle]] API call will remove the group or stream from the Data Recorder window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a digital pin or port to a program stream======&lt;br /&gt;
&lt;br /&gt;
A digital pin or port can be assigned to a stream object handle by using the [[API_Scope.AddPort|AddPort]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the port index where PORTA is 0, PORTB is 1 etc. &lt;br /&gt;
*the BitMask parameter. This is a binary AND mask which selects which bits of the port will be available on the stream. &lt;br /&gt;
*The PackMask parameter. Setting this to 1 will move all the active bits together if necessary. &lt;br /&gt;
*The merge parameter. This allows you to add multiple ports or pins to a single stream. Set this to 1 if you are adding a digital pin or port to an existing stream that already contains data, and you wish to combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single pin (e.g. Port A, Pin 0) with an LED connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope5.jpg]] &amp;lt;!-- AddPort call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to toggle the LED with the signal being replicated on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope6.jpg]] &amp;lt;!-- LED program with Data Recorder --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To monitor a full port (e.g. Port B)with a LED Array connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope7.jpg]] &amp;lt;!-- AddPort full port call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then scale the stream to get the value in the range of 0-1 by calling the [[API_Scope.AddOp|AddOp]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope8.jpg]] &amp;lt;!-- AddOp call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to generate a digital counter on Port B, with the signal being replicated on the Data Recorder. The [[API_System.ShowHandle|ShowHandle]] function allows the Data Recorder window to appear automatically without the user having to manually open the window. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope14.jpg]] &amp;lt;!-- digital counter program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding an analogue pin to a program stream======&lt;br /&gt;
&lt;br /&gt;
An analogue pin can be assigned to a stream object handle by using the [[API_Scope.AddAnalog|AddAnalog]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the analogue channel index where An0 is 0, An1 is 1 etc. &lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple analogue signals on a single stream. Set this to 1 if you are adding an analog pin to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single analogue pin (e.g. pin An0), with a potentiometer connected, we can call the [[API_Scope.AddAnalog|AddAnalog]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope9.jpg]] &amp;lt;!-- AddAnalog function call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the value of pin An0, based on the position of the potentiometer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope10.jpg]] &amp;lt;!-- potentiometer program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a custom value to a program stream======&lt;br /&gt;
&lt;br /&gt;
Custom values are those that do not correspond directly to pins or ports. A custom value can be assigned to a stream object handle by using the [[API_Scope.AddCustom|AddCustom]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the custom channel index 0-31. These act as “slots” in which to store your data. Select a value that is not used by any other custom streams.&lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple custom channels on a single stream. Set this to 1 if you are adding a custom channel to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data.&lt;br /&gt;
 &lt;br /&gt;
To create a single custom stream, we can call the [[API_Scope.AddCustom|AddCustom]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope11.jpg]] &amp;lt;!-- AddCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data for a custom channel cannot come from a digital or analogue channel automatically. Instead we have to manually pass the data to the custom channel. This is done by using the [[API_Scope.SetCustom|SetCustom]] function call. The value passed should be a floating-point real number in the range between 0 and 1 (so to convert a byte variable we would have to divide by the value 255.0.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope13.jpg]] &amp;lt;!-- SetCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program which creates a custom stream, adds custom channel 0 to it, and then continually:&lt;br /&gt;
# tracks the values of two analogue input signals&lt;br /&gt;
# calculates the average between the two readings. &lt;br /&gt;
# sends the data to custom channel 0, which appears on the Data Recorder in the created stream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope12.jpg]] &amp;lt;!-- custom program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Interacting with streams===&lt;br /&gt;
&lt;br /&gt;
You can change the time span that is being examined by using the drop down on the top-right of the window. Alternatively, you can use your mouse’s scroll wheel. Using the scroll wheel is even more powerful as it allows you to zoom directly over a particular point of interest.&lt;br /&gt;
Stream heights can be modified by dragging the bottom border of the left hand pane for the relevant stream. Colours used for rendering can be modified on the fly directly, by clicking the top square next to the stream name (for the stream background colour), and the bottom square next to the stream name (for the stream waveform/foreground colour)&lt;br /&gt;
&lt;br /&gt;
Hovering your mouse over the stream will show you the time interval between the two peaks that surround the cursor. Note that in simulation mode, this timing is not accurate.&lt;br /&gt;
&lt;br /&gt;
===Packet Decoding===&lt;br /&gt;
&lt;br /&gt;
Communications buses can be decoded to work out what values a bus is sending out and receiving. &lt;br /&gt;
&lt;br /&gt;
Supported Busses:&lt;br /&gt;
*UART (RS232, GSM, GPS, Modbus, Bluetooth, ...) &lt;br /&gt;
*SPI (SPI Master, FAT, EEPROM, RTC, ...) &lt;br /&gt;
*I2C (I2C Master, Accelerometer, EEPROM, RTC, ...) &lt;br /&gt;
&lt;br /&gt;
Packet decoding is available for certain program streams added by components. The button for decoding becomes available when the relevant communication component is added to the panel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--DecodeButton.png--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Decoding is then done by clicking the decode stream button on the appropriate stream. Streams can be decoded regardless of whether the Data Recorder is running in simulation or Ghost mode.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Image of packet decoding here (SPI master)--&amp;gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23442</id>
		<title>Using the Data Recorder</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23442"/>
		<updated>2019-05-16T10:03:49Z</updated>

		<summary type="html">&lt;p&gt;DanielM: /* How to use */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a Data Recorder ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside Ghost Technology to allow users to monitor signals in real time using In-Circuit-Test. It can also be used in simulation mode, though timing of signals is not accurate when using simulation. In simulation, it allows the user to see the results and values from raw data and components such as dials and measures. This data allows you to monitor the state of the various signals plotted to various channels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_recorder_wave_and_packets.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Data Recorder is very useful for analyzing data as it can accurately display information to identify patterns in the data as well as the speed data is being displayed at. Components such as the DSP range will automatically create their own Data Recorder channels, allowing for very simple yet powerful means of monitoring and debugging the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
====Adding streams====&lt;br /&gt;
&lt;br /&gt;
Streams are separated via two types: user streams and program streams. &lt;br /&gt;
&lt;br /&gt;
=====User streams=====&lt;br /&gt;
&lt;br /&gt;
User streams are simple streams that allow you to easily monitor the value of a digital or analog pin. They can be added by simply clicking the “Add pin trace” button on the Data Recorder itself and selecting the appropriate digital or analog pin. &lt;br /&gt;
&lt;br /&gt;
This method of adding streams is recommended if you are using Ghost technology (link) to view live pin data from your Matrix hardware.&lt;br /&gt;
&lt;br /&gt;
[[File:Data_Recorder_Add_Data.png|x150px|border|Adding pins to the Data Recorder]]&lt;br /&gt;
&lt;br /&gt;
=====Program streams=====&lt;br /&gt;
&lt;br /&gt;
Program streams are added by components or by flowchart icons in your program. For some components, simply adding it to the 2d or 3d panel causes a program stream to appear in the Data Recorder. These streams are then controlled by the component itself and will be removed automatically when appropriate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Image of program streams added by SPI master.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we will give an example of creating your own program stream using flowchart icons.&lt;br /&gt;
&lt;br /&gt;
======Creating a stream group======&lt;br /&gt;
&lt;br /&gt;
To create a new stream group you first need to create a global “Handle” type variable to store the reference to the stream group. This is basically a unique number which used to refer to that specific group of streams in the Data Recorder. To do this, open the [[Project_Explorer|Project Explorer]] window and select the “Globals” tab. Next, right click the “Variables” portion of the tree view and select “Add New” from the menu. In the “Create a New Variable” dialogue that pops up give the variable a meaningful name such as “DRGroupHandle”, then switch the variable type to “Object handle” and click “OK”. You should then get an Object handle variable appearing in the [[Project_Explorer|Project Explorer]] window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope1.jpg]] &amp;lt;!--Created handle variable called DRGroupHandle--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we need to assign the handle variable with a value by calling the Flowcode API. To do this we add a Simulation Macro (link) icon to the “Main” flowchart. Then we double-click the icon on the flowchart to edit the icon's properties. Inside the icon property window we first need to ensure that the “Functions” tab is selected and then scroll down to the “DataRecorder” section before clicking the + icon to see all the API calls related to the Data Recorder’s functionality. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope2.jpg]] &amp;lt;!-- List of DataRecorder API functions --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddGroup|AddGroup]] function call creates a new named group of streams on the Data Recorder. The return value of the function call requires a handle type variable. You should set this to the name of the variable we have created previously (“DRGroupHandle” in this example). Type a name that you want into the parameter field, (such as “Test Group”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3A.jpg]] &amp;lt;!-- Image of AddGroup with variable entered and “Test Group” --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddStream|AddStream]] function call adds a new named stream to the group on the Data Recorder. The return value of the function call is a handle type variable. We will have to create a new global object handle type variable to store this. This handle must be unique for each single stream so you must use a new object handle variable for every program stream that you create on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope3B.jpg]] &amp;lt;!-- Image of AddStream with DRGroupHandle, DRStreamHandle return --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we run the simulation the new group will be created on the Data Recorder ready for data to be streamed in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3.jpg]] &amp;lt;!-- flow icons and created stream image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are creating your own Flowcode component, you can move these from the Main macro to the [[Event_Components.Initialise|simulation initialise event]] macro so that the group and stream are created automatically when the component is added to a program. This is the way that components such as the DSP based components add their data to the console window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope4.jpg]] &amp;lt;!-- Ev_initialise image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a group with no valid stream handles will not show up on the Data Recorder window just to try and avoid potential unnecessary clutter. &lt;br /&gt;
Setting the handle variable to the value of 0 using a [[Calculation_Icon_Properties|Calculation icon]] or calling the [[API_System.DeleteHandle|System -&amp;gt; DeleteHandle]] API call will remove the group or stream from the Data Recorder window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a digital pin or port to a program stream======&lt;br /&gt;
&lt;br /&gt;
A digital pin or port can be assigned to a stream object handle by using the [[API_Scope.AddPort|AddPort]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the port index where PORTA is 0, PORTB is 1 etc. &lt;br /&gt;
*the BitMask parameter. This is a binary AND mask which selects which bits of the port will be available on the stream. &lt;br /&gt;
*The PackMask parameter. Setting this to 1 will move all the active bits together if necessary. &lt;br /&gt;
*The merge parameter. This allows you to add multiple ports or pins to a single stream. Set this to 1 if you are adding a digital pin or port to an existing stream that already contains data, and you wish to combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single pin (e.g. Port A, Pin 0) with an LED connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope5.jpg]] &amp;lt;!-- AddPort call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to toggle the LED with the signal being replicated on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope6.jpg]] &amp;lt;!-- LED program with Data Recorder --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To monitor a full port (e.g. Port B)with a LED Array connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope7.jpg]] &amp;lt;!-- AddPort full port call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then scale the stream to get the value in the range of 0-1 by calling the [[API_Scope.AddOp|AddOp]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope8.jpg]] &amp;lt;!-- AddOp call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to generate a digital counter on Port B, with the signal being replicated on the Data Recorder. The [[API_System.ShowHandle|ShowHandle]] function allows the Data Recorder window to appear automatically without the user having to manually open the window. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope14.jpg]] &amp;lt;!-- digital counter program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding an analogue pin to a program stream======&lt;br /&gt;
&lt;br /&gt;
An analogue pin can be assigned to a stream object handle by using the [[API_Scope.AddAnalog|AddAnalog]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the analogue channel index where An0 is 0, An1 is 1 etc. &lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple analogue signals on a single stream. Set this to 1 if you are adding an analog pin to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single analogue pin (e.g. pin An0), with a potentiometer connected, we can call the [[API_Scope.AddAnalog|AddAnalog]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope9.jpg]] &amp;lt;!-- AddAnalog function call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the value of pin An0, based on the position of the potentiometer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope10.jpg]] &amp;lt;!-- potentiometer program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a custom value to a program stream======&lt;br /&gt;
&lt;br /&gt;
Custom values are those that do not correspond directly to pins or ports. A custom value can be assigned to a stream object handle by using the [[API_Scope.AddCustom|AddCustom]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the custom channel index 0-31. These act as “slots” in which to store your data. Select a value that is not used by any other custom streams.&lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple custom channels on a single stream. Set this to 1 if you are adding a custom channel to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data.&lt;br /&gt;
 &lt;br /&gt;
To create a single custom stream, we can call the [[API_Scope.AddCustom|AddCustom]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope11.jpg]] &amp;lt;!-- AddCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data for a custom channel cannot come from a digital or analogue channel automatically. Instead we have to manually pass the data to the custom channel. This is done by using the [[API_Scope.SetCustom|SetCustom]] function call. The value passed should be a floating-point real number in the range between 0 and 1 (so to convert a byte variable we would have to divide by the value 255.0.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope13.jpg]] &amp;lt;!-- SetCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program which creates a custom stream, adds custom channel 0 to it, and then continually:&lt;br /&gt;
# tracks the values of two analogue input signals&lt;br /&gt;
# calculates the average between the two readings. &lt;br /&gt;
# sends the data to custom channel 0, which appears on the Data Recorder in the created stream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope12.jpg]] &amp;lt;!-- custom program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Interacting with streams===&lt;br /&gt;
&lt;br /&gt;
You can change the time span that is being examined by using the drop down on the top-right of the window. Alternatively, you can use your mouse’s scroll wheel. Using the scroll wheel is even more powerful as it allows you to zoom directly over a particular point of interest.&lt;br /&gt;
Stream heights can be modified by dragging the bottom border of the left hand pane for the relevant stream. Colours used for rendering can be modified on the fly directly, by clicking the top square next to the stream name (for the stream background colour), and the bottom square next to the stream name (for the stream waveform/foreground colour)&lt;br /&gt;
&lt;br /&gt;
Hovering your mouse over the stream will show you the time interval between the two peaks that surround the cursor. Note that in simulation mode, this timing is not accurate.&lt;br /&gt;
&lt;br /&gt;
===Packet Decoding===&lt;br /&gt;
&lt;br /&gt;
Communications buses can be decoded to work out what values a bus is sending out and receiving. &lt;br /&gt;
&lt;br /&gt;
Supported Busses:&lt;br /&gt;
*UART (RS232, GSM, GPS, Modbus, Bluetooth, ...) &lt;br /&gt;
*SPI (SPI Master, FAT, EEPROM, RTC, ...) &lt;br /&gt;
*I2C (I2C Master, Accelerometer, EEPROM, RTC, ...) &lt;br /&gt;
&lt;br /&gt;
Packet decoding is available for certain program streams added by components. The button for decoding becomes available when the relevant communication component is added to the panel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--DecodeButton.png--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Decoding is then done by clicking the decode stream button on the appropriate stream. Streams can be decoded regardless of whether the Data Recorder is running in simulation or Ghost mode.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Image of packet decoding here (SPI master)--&amp;gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23441</id>
		<title>Using the Data Recorder</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23441"/>
		<updated>2019-05-16T10:01:30Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a Data Recorder ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside Ghost Technology to allow users to monitor signals in real time using In-Circuit-Test. It can also be used in simulation mode, though timing of signals is not accurate when using simulation. In simulation, it allows the user to see the results and values from raw data and components such as dials and measures. This data allows you to monitor the state of the various signals plotted to various channels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Data_recorder_wave_and_packets.png|border|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Data Recorder is very useful for analyzing data as it can accurately display information to identify patterns in the data as well as the speed data is being displayed at. Components such as the DSP range will automatically create their own Data Recorder channels, allowing for very simple yet powerful means of monitoring and debugging the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
====Adding streams====&lt;br /&gt;
&lt;br /&gt;
Streams are separated via two types: user streams and program streams. &lt;br /&gt;
&lt;br /&gt;
=====User streams=====&lt;br /&gt;
&lt;br /&gt;
User streams are simple streams that allow you to easily monitor the value of a digital or analog pin. They can be added by simply clicking the “Add pin trace” button on the Data Recorder itself and selecting the appropriate digital or analog pin. &lt;br /&gt;
&lt;br /&gt;
This method of adding streams is recommended if you are using Ghost technology (link) to view live pin data from your Matrix hardware.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Image here of Add pin trace button.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Program streams=====&lt;br /&gt;
&lt;br /&gt;
Program streams are added by components or by flowchart icons in your program. For some components, simply adding it to the 2d or 3d panel causes a program stream to appear in the Data Recorder. These streams are then controlled by the component itself and will be removed automatically when appropriate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Image of program streams added by SPI master.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we will give an example of creating your own program stream using flowchart icons.&lt;br /&gt;
&lt;br /&gt;
======Creating a stream group======&lt;br /&gt;
&lt;br /&gt;
To create a new stream group you first need to create a global “Handle” type variable to store the reference to the stream group. This is basically a unique number which used to refer to that specific group of streams in the Data Recorder. To do this, open the [[Project_Explorer|Project Explorer]] window and select the “Globals” tab. Next, right click the “Variables” portion of the tree view and select “Add New” from the menu. In the “Create a New Variable” dialogue that pops up give the variable a meaningful name such as “DRGroupHandle”, then switch the variable type to “Object handle” and click “OK”. You should then get an Object handle variable appearing in the [[Project_Explorer|Project Explorer]] window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope1.jpg]] &amp;lt;!--Created handle variable called DRGroupHandle--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we need to assign the handle variable with a value by calling the Flowcode API. To do this we add a Simulation Macro (link) icon to the “Main” flowchart. Then we double-click the icon on the flowchart to edit the icon's properties. Inside the icon property window we first need to ensure that the “Functions” tab is selected and then scroll down to the “DataRecorder” section before clicking the + icon to see all the API calls related to the Data Recorder’s functionality. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope2.jpg]] &amp;lt;!-- List of DataRecorder API functions --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddGroup|AddGroup]] function call creates a new named group of streams on the Data Recorder. The return value of the function call requires a handle type variable. You should set this to the name of the variable we have created previously (“DRGroupHandle” in this example). Type a name that you want into the parameter field, (such as “Test Group”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3A.jpg]] &amp;lt;!-- Image of AddGroup with variable entered and “Test Group” --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddStream|AddStream]] function call adds a new named stream to the group on the Data Recorder. The return value of the function call is a handle type variable. We will have to create a new global object handle type variable to store this. This handle must be unique for each single stream so you must use a new object handle variable for every program stream that you create on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope3B.jpg]] &amp;lt;!-- Image of AddStream with DRGroupHandle, DRStreamHandle return --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we run the simulation the new group will be created on the Data Recorder ready for data to be streamed in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3.jpg]] &amp;lt;!-- flow icons and created stream image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are creating your own Flowcode component, you can move these from the Main macro to the [[Event_Components.Initialise|simulation initialise event]] macro so that the group and stream are created automatically when the component is added to a program. This is the way that components such as the DSP based components add their data to the console window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope4.jpg]] &amp;lt;!-- Ev_initialise image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a group with no valid stream handles will not show up on the Data Recorder window just to try and avoid potential unnecessary clutter. &lt;br /&gt;
Setting the handle variable to the value of 0 using a [[Calculation_Icon_Properties|Calculation icon]] or calling the [[API_System.DeleteHandle|System -&amp;gt; DeleteHandle]] API call will remove the group or stream from the Data Recorder window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a digital pin or port to a program stream======&lt;br /&gt;
&lt;br /&gt;
A digital pin or port can be assigned to a stream object handle by using the [[API_Scope.AddPort|AddPort]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the port index where PORTA is 0, PORTB is 1 etc. &lt;br /&gt;
*the BitMask parameter. This is a binary AND mask which selects which bits of the port will be available on the stream. &lt;br /&gt;
*The PackMask parameter. Setting this to 1 will move all the active bits together if necessary. &lt;br /&gt;
*The merge parameter. This allows you to add multiple ports or pins to a single stream. Set this to 1 if you are adding a digital pin or port to an existing stream that already contains data, and you wish to combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single pin (e.g. Port A, Pin 0) with an LED connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope5.jpg]] &amp;lt;!-- AddPort call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to toggle the LED with the signal being replicated on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope6.jpg]] &amp;lt;!-- LED program with Data Recorder --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To monitor a full port (e.g. Port B)with a LED Array connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope7.jpg]] &amp;lt;!-- AddPort full port call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then scale the stream to get the value in the range of 0-1 by calling the [[API_Scope.AddOp|AddOp]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope8.jpg]] &amp;lt;!-- AddOp call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to generate a digital counter on Port B, with the signal being replicated on the Data Recorder. The [[API_System.ShowHandle|ShowHandle]] function allows the Data Recorder window to appear automatically without the user having to manually open the window. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope14.jpg]] &amp;lt;!-- digital counter program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding an analogue pin to a program stream======&lt;br /&gt;
&lt;br /&gt;
An analogue pin can be assigned to a stream object handle by using the [[API_Scope.AddAnalog|AddAnalog]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the analogue channel index where An0 is 0, An1 is 1 etc. &lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple analogue signals on a single stream. Set this to 1 if you are adding an analog pin to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single analogue pin (e.g. pin An0), with a potentiometer connected, we can call the [[API_Scope.AddAnalog|AddAnalog]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope9.jpg]] &amp;lt;!-- AddAnalog function call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the value of pin An0, based on the position of the potentiometer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope10.jpg]] &amp;lt;!-- potentiometer program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a custom value to a program stream======&lt;br /&gt;
&lt;br /&gt;
Custom values are those that do not correspond directly to pins or ports. A custom value can be assigned to a stream object handle by using the [[API_Scope.AddCustom|AddCustom]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the custom channel index 0-31. These act as “slots” in which to store your data. Select a value that is not used by any other custom streams.&lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple custom channels on a single stream. Set this to 1 if you are adding a custom channel to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data.&lt;br /&gt;
 &lt;br /&gt;
To create a single custom stream, we can call the [[API_Scope.AddCustom|AddCustom]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope11.jpg]] &amp;lt;!-- AddCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data for a custom channel cannot come from a digital or analogue channel automatically. Instead we have to manually pass the data to the custom channel. This is done by using the [[API_Scope.SetCustom|SetCustom]] function call. The value passed should be a floating-point real number in the range between 0 and 1 (so to convert a byte variable we would have to divide by the value 255.0.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope13.jpg]] &amp;lt;!-- SetCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program which creates a custom stream, adds custom channel 0 to it, and then continually:&lt;br /&gt;
# tracks the values of two analogue input signals&lt;br /&gt;
# calculates the average between the two readings. &lt;br /&gt;
# sends the data to custom channel 0, which appears on the Data Recorder in the created stream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope12.jpg]] &amp;lt;!-- custom program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Interacting with streams===&lt;br /&gt;
&lt;br /&gt;
You can change the time span that is being examined by using the drop down on the top-right of the window. Alternatively, you can use your mouse’s scroll wheel. Using the scroll wheel is even more powerful as it allows you to zoom directly over a particular point of interest.&lt;br /&gt;
Stream heights can be modified by dragging the bottom border of the left hand pane for the relevant stream. Colours used for rendering can be modified on the fly directly, by clicking the top square next to the stream name (for the stream background colour), and the bottom square next to the stream name (for the stream waveform/foreground colour)&lt;br /&gt;
&lt;br /&gt;
Hovering your mouse over the stream will show you the time interval between the two peaks that surround the cursor. Note that in simulation mode, this timing is not accurate.&lt;br /&gt;
&lt;br /&gt;
===Packet Decoding===&lt;br /&gt;
&lt;br /&gt;
Communications buses can be decoded to work out what values a bus is sending out and receiving. &lt;br /&gt;
&lt;br /&gt;
Supported Busses:&lt;br /&gt;
*UART (RS232, GSM, GPS, Modbus, Bluetooth, ...) &lt;br /&gt;
*SPI (SPI Master, FAT, EEPROM, RTC, ...) &lt;br /&gt;
*I2C (I2C Master, Accelerometer, EEPROM, RTC, ...) &lt;br /&gt;
&lt;br /&gt;
Packet decoding is available for certain program streams added by components. The button for decoding becomes available when the relevant communication component is added to the panel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--DecodeButton.png--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Decoding is then done by clicking the decode stream button on the appropriate stream. Streams can be decoded regardless of whether the Data Recorder is running in simulation or Ghost mode.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Image of packet decoding here (SPI master)--&amp;gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:Data_recorder_wave_and_packets.png&amp;diff=23440</id>
		<title>File:Data recorder wave and packets.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:Data_recorder_wave_and_packets.png&amp;diff=23440"/>
		<updated>2019-05-16T09:59:56Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23439</id>
		<title>Using the Data Recorder</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23439"/>
		<updated>2019-05-16T09:59:17Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a Data Recorder ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside Ghost Technology to allow users to monitor signals in real time using In-Circuit-Test. It can also be used in simulation mode, though timing of signals is not accurate when using simulation. In simulation, it allows the user to see the results and values from raw data and components such as dials and measures. This data allows you to monitor the state of the various signals plotted to various channels. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Image of Data Recorder--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The Data Recorder is very useful for analyzing data as it can accurately display information to identify patterns in the data as well as the speed data is being displayed at. Components such as the DSP range will automatically create their own Data Recorder channels, allowing for very simple yet powerful means of monitoring and debugging the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
====Adding streams====&lt;br /&gt;
&lt;br /&gt;
Streams are separated via two types: user streams and program streams. &lt;br /&gt;
&lt;br /&gt;
=====User streams=====&lt;br /&gt;
&lt;br /&gt;
User streams are simple streams that allow you to easily monitor the value of a digital or analog pin. They can be added by simply clicking the “Add pin trace” button on the Data Recorder itself and selecting the appropriate digital or analog pin. &lt;br /&gt;
&lt;br /&gt;
This method of adding streams is recommended if you are using Ghost technology (link) to view live pin data from your Matrix hardware.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Image here of Add pin trace button.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Program streams=====&lt;br /&gt;
&lt;br /&gt;
Program streams are added by components or by flowchart icons in your program. For some components, simply adding it to the 2d or 3d panel causes a program stream to appear in the Data Recorder. These streams are then controlled by the component itself and will be removed automatically when appropriate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Image of program streams added by SPI master.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we will give an example of creating your own program stream using flowchart icons.&lt;br /&gt;
&lt;br /&gt;
======Creating a stream group======&lt;br /&gt;
&lt;br /&gt;
To create a new stream group you first need to create a global “Handle” type variable to store the reference to the stream group. This is basically a unique number which used to refer to that specific group of streams in the Data Recorder. To do this, open the [[Project_Explorer|Project Explorer]] window and select the “Globals” tab. Next, right click the “Variables” portion of the tree view and select “Add New” from the menu. In the “Create a New Variable” dialogue that pops up give the variable a meaningful name such as “DRGroupHandle”, then switch the variable type to “Object handle” and click “OK”. You should then get an Object handle variable appearing in the [[Project_Explorer|Project Explorer]] window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope1.jpg]] &amp;lt;!--Created handle variable called DRGroupHandle--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we need to assign the handle variable with a value by calling the Flowcode API. To do this we add a Simulation Macro (link) icon to the “Main” flowchart. Then we double-click the icon on the flowchart to edit the icon's properties. Inside the icon property window we first need to ensure that the “Functions” tab is selected and then scroll down to the “DataRecorder” section before clicking the + icon to see all the API calls related to the Data Recorder’s functionality. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope2.jpg]] &amp;lt;!-- List of DataRecorder API functions --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddGroup|AddGroup]] function call creates a new named group of streams on the Data Recorder. The return value of the function call requires a handle type variable. You should set this to the name of the variable we have created previously (“DRGroupHandle” in this example). Type a name that you want into the parameter field, (such as “Test Group”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3A.jpg]] &amp;lt;!-- Image of AddGroup with variable entered and “Test Group” --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddStream|AddStream]] function call adds a new named stream to the group on the Data Recorder. The return value of the function call is a handle type variable. We will have to create a new global object handle type variable to store this. This handle must be unique for each single stream so you must use a new object handle variable for every program stream that you create on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope3B.jpg]] &amp;lt;!-- Image of AddStream with DRGroupHandle, DRStreamHandle return --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we run the simulation the new group will be created on the Data Recorder ready for data to be streamed in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3.jpg]] &amp;lt;!-- flow icons and created stream image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are creating your own Flowcode component, you can move these from the Main macro to the [[Event_Components.Initialise|simulation initialise event]] macro so that the group and stream are created automatically when the component is added to a program. This is the way that components such as the DSP based components add their data to the console window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope4.jpg]] &amp;lt;!-- Ev_initialise image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a group with no valid stream handles will not show up on the Data Recorder window just to try and avoid potential unnecessary clutter. &lt;br /&gt;
Setting the handle variable to the value of 0 using a [[Calculation_Icon_Properties|Calculation icon]] or calling the [[API_System.DeleteHandle|System -&amp;gt; DeleteHandle]] API call will remove the group or stream from the Data Recorder window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a digital pin or port to a program stream======&lt;br /&gt;
&lt;br /&gt;
A digital pin or port can be assigned to a stream object handle by using the [[API_Scope.AddPort|AddPort]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the port index where PORTA is 0, PORTB is 1 etc. &lt;br /&gt;
*the BitMask parameter. This is a binary AND mask which selects which bits of the port will be available on the stream. &lt;br /&gt;
*The PackMask parameter. Setting this to 1 will move all the active bits together if necessary. &lt;br /&gt;
*The merge parameter. This allows you to add multiple ports or pins to a single stream. Set this to 1 if you are adding a digital pin or port to an existing stream that already contains data, and you wish to combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single pin (e.g. Port A, Pin 0) with an LED connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope5.jpg]] &amp;lt;!-- AddPort call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to toggle the LED with the signal being replicated on the Data Recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope6.jpg]] &amp;lt;!-- LED program with Data Recorder --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To monitor a full port (e.g. Port B)with a LED Array connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope7.jpg]] &amp;lt;!-- AddPort full port call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then scale the stream to get the value in the range of 0-1 by calling the [[API_Scope.AddOp|AddOp]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope8.jpg]] &amp;lt;!-- AddOp call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to generate a digital counter on Port B, with the signal being replicated on the Data Recorder. The [[API_System.ShowHandle|ShowHandle]] function allows the Data Recorder window to appear automatically without the user having to manually open the window. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope14.jpg]] &amp;lt;!-- digital counter program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding an analogue pin to a program stream======&lt;br /&gt;
&lt;br /&gt;
An analogue pin can be assigned to a stream object handle by using the [[API_Scope.AddAnalog|AddAnalog]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the analogue channel index where An0 is 0, An1 is 1 etc. &lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple analogue signals on a single stream. Set this to 1 if you are adding an analog pin to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single analogue pin (e.g. pin An0), with a potentiometer connected, we can call the [[API_Scope.AddAnalog|AddAnalog]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope9.jpg]] &amp;lt;!-- AddAnalog function call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the value of pin An0, based on the position of the potentiometer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope10.jpg]] &amp;lt;!-- potentiometer program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a custom value to a program stream======&lt;br /&gt;
&lt;br /&gt;
Custom values are those that do not correspond directly to pins or ports. A custom value can be assigned to a stream object handle by using the [[API_Scope.AddCustom|AddCustom]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the custom channel index 0-31. These act as “slots” in which to store your data. Select a value that is not used by any other custom streams.&lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple custom channels on a single stream. Set this to 1 if you are adding a custom channel to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data.&lt;br /&gt;
 &lt;br /&gt;
To create a single custom stream, we can call the [[API_Scope.AddCustom|AddCustom]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope11.jpg]] &amp;lt;!-- AddCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data for a custom channel cannot come from a digital or analogue channel automatically. Instead we have to manually pass the data to the custom channel. This is done by using the [[API_Scope.SetCustom|SetCustom]] function call. The value passed should be a floating-point real number in the range between 0 and 1 (so to convert a byte variable we would have to divide by the value 255.0.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope13.jpg]] &amp;lt;!-- SetCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program which creates a custom stream, adds custom channel 0 to it, and then continually:&lt;br /&gt;
# tracks the values of two analogue input signals&lt;br /&gt;
# calculates the average between the two readings. &lt;br /&gt;
# sends the data to custom channel 0, which appears on the Data Recorder in the created stream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope12.jpg]] &amp;lt;!-- custom program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Interacting with streams===&lt;br /&gt;
&lt;br /&gt;
You can change the time span that is being examined by using the drop down on the top-right of the window. Alternatively, you can use your mouse’s scroll wheel. Using the scroll wheel is even more powerful as it allows you to zoom directly over a particular point of interest.&lt;br /&gt;
Stream heights can be modified by dragging the bottom border of the left hand pane for the relevant stream. Colours used for rendering can be modified on the fly directly, by clicking the top square next to the stream name (for the stream background colour), and the bottom square next to the stream name (for the stream waveform/foreground colour)&lt;br /&gt;
&lt;br /&gt;
Hovering your mouse over the stream will show you the time interval between the two peaks that surround the cursor. Note that in simulation mode, this timing is not accurate.&lt;br /&gt;
&lt;br /&gt;
===Packet Decoding===&lt;br /&gt;
&lt;br /&gt;
Communications buses can be decoded to work out what values a bus is sending out and receiving. &lt;br /&gt;
&lt;br /&gt;
Supported Busses:&lt;br /&gt;
*UART (RS232, GSM, GPS, Modbus, Bluetooth, ...) &lt;br /&gt;
*SPI (SPI Master, FAT, EEPROM, RTC, ...) &lt;br /&gt;
*I2C (I2C Master, Accelerometer, EEPROM, RTC, ...) &lt;br /&gt;
&lt;br /&gt;
Packet decoding is available for certain program streams added by components. The button for decoding becomes available when the relevant communication component is added to the panel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--DecodeButton.png--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Decoding is then done by clicking the decode stream button on the appropriate stream. Streams can be decoded regardless of whether the Data Recorder is running in simulation or Ghost mode.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Image of packet decoding here (SPI master)--&amp;gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23437</id>
		<title>Using the Data Recorder</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23437"/>
		<updated>2019-05-16T09:55:22Z</updated>

		<summary type="html">&lt;p&gt;DanielM: DanielM moved page Using the Data Scope to Using the Data Recorder&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a data recorder ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside Ghost Technology to allow users to monitor signals in real time using In-Circuit-Test. It can also be used in simulation mode, though timing of signals is not accurate when using simulation. In simulation, it allows the user to see the results and values from raw data and components such as dials and measures. This data allows you to monitor the state of the various signals plotted to various channels. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Image of Data Recorder--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The data recorder is very useful for analyzing data as it can accurately display information to identify patterns in the data as well as the speed data is being displayed at. Components such as the DSP range will automatically create their own Data Recorder channels, allowing for very simple yet powerful means of monitoring and debugging the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
====Adding streams====&lt;br /&gt;
&lt;br /&gt;
Streams are separated via two types: user streams and program streams. &lt;br /&gt;
&lt;br /&gt;
=====User streams=====&lt;br /&gt;
&lt;br /&gt;
User streams are simple streams that allow you to easily monitor the value of a digital or analog pin. They can be added by simply clicking the “Add pin trace” button on the data recorder itself and selecting the appropriate digital or analog pin. &lt;br /&gt;
&lt;br /&gt;
This method of adding streams is recommended if you are using Ghost technology (link) to view live pin data from your Matrix hardware.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Image here of Add pin trace button.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Program streams=====&lt;br /&gt;
&lt;br /&gt;
Program streams are added by components or by flowchart icons in your program. For some components, simply adding it to the 2d or 3d panel causes a program stream to appear in the data recorder. These streams are then controlled by the component itself and will be removed automatically when appropriate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Image of program streams added by SPI master.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we will give an example of creating your own program stream using flowchart icons.&lt;br /&gt;
&lt;br /&gt;
======Creating a stream group======&lt;br /&gt;
&lt;br /&gt;
To create a new stream group you first need to create a global “Handle” type variable to store the reference to the stream group. This is basically a unique number which used to refer to that specific group of streams in the data recorder. To do this, open the [[Project_Explorer|Project Explorer]] window and select the “Globals” tab. Next, right click the “Variables” portion of the tree view and select “Add New” from the menu. In the “Create a New Variable” dialogue that pops up give the variable a meaningful name such as “DRGroupHandle”, then switch the variable type to “Object handle” and click “OK”. You should then get an Object handle variable appearing in the [[Project_Explorer|Project Explorer]] window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope1.jpg]] &amp;lt;!--Created handle variable called DRGroupHandle--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we need to assign the handle variable with a value by calling the Flowcode API. To do this we add a Simulation Macro (link) icon to the “Main” flowchart. Then we double-click the icon on the flowchart to edit the icon's properties. Inside the icon property window we first need to ensure that the “Functions” tab is selected and then scroll down to the “DataRecorder” section before clicking the + icon to see all the API calls related to the data recorder’s functionality. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope2.jpg]] &amp;lt;!-- List of DataRecorder API functions --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddGroup|AddGroup]] function call creates a new named group of streams on the data recorder. The return value of the function call requires a handle type variable. You should set this to the name of the variable we have created previously (“DRGroupHandle” in this example). Type a name that you want into the parameter field, (such as “Test Group”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3A.jpg]] &amp;lt;!-- Image of AddGroup with variable entered and “Test Group” --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddStream|AddStream]] function call adds a new named stream to the group on the data recorder. The return value of the function call is a handle type variable. We will have to create a new global object handle type variable to store this. This handle must be unique for each single stream so you must use a new object handle variable for every program stream that you create on the data recorder. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope3B.jpg]] &amp;lt;!-- Image of AddStream with DRGroupHandle, DRStreamHandle return --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we run the simulation the new group will be created on the data recorder ready for data to be streamed in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3.jpg]] &amp;lt;!-- flow icons and created stream image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are creating your own Flowcode component, you can move these from the Main macro to the [[Event_Components.Initialise|simulation initialise event]] macro so that the group and stream are created automatically when the component is added to a program. This is the way that components such as the DSP based components add their data to the console window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope4.jpg]] &amp;lt;!-- Ev_initialise image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a group with no valid stream handles will not show up on the data recorder window just to try and avoid potential unnecessary clutter. &lt;br /&gt;
Setting the handle variable to the value of 0 using a [[Calculation_Icon_Properties|Calculation icon]] or calling the [[API_System.DeleteHandle|System -&amp;gt; DeleteHandle]] API call will remove the group or stream from the data recorder window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a digital pin or port to a program stream======&lt;br /&gt;
&lt;br /&gt;
A digital pin or port can be assigned to a stream object handle by using the [[API_Scope.AddPort|AddPort]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the port index where PORTA is 0, PORTB is 1 etc. &lt;br /&gt;
*the BitMask parameter. This is a binary AND mask which selects which bits of the port will be available on the stream. &lt;br /&gt;
*The PackMask parameter. Setting this to 1 will move all the active bits together if necessary. &lt;br /&gt;
*The merge parameter. This allows you to add multiple ports or pins to a single stream. Set this to 1 if you are adding a digital pin or port to an existing stream that already contains data, and you wish to combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single pin (e.g. Port A, Pin 0) with an LED connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope5.jpg]] &amp;lt;!-- AddPort call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to toggle the LED with the signal being replicated on the data recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope6.jpg]] &amp;lt;!-- LED program with data recorder --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To monitor a full port (e.g. Port B)with a LED Array connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope7.jpg]] &amp;lt;!-- AddPort full port call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then scale the stream to get the value in the range of 0-1 by calling the [[API_Scope.AddOp|AddOp]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope8.jpg]] &amp;lt;!-- AddOp call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to generate a digital counter on Port B, with the signal being replicated on the data recorder. The [[API_System.ShowHandle|ShowHandle]] function allows the data recorder window to appear automatically without the user having to manually open the window. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope14.jpg]] &amp;lt;!-- digital counter program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding an analogue pin to a program stream======&lt;br /&gt;
&lt;br /&gt;
An analogue pin can be assigned to a stream object handle by using the [[API_Scope.AddAnalog|AddAnalog]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the analogue channel index where An0 is 0, An1 is 1 etc. &lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple analogue signals on a single stream. Set this to 1 if you are adding an analog pin to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single analogue pin (e.g. pin An0), with a potentiometer connected, we can call the [[API_Scope.AddAnalog|AddAnalog]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope9.jpg]] &amp;lt;!-- AddAnalog function call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the value of pin An0, based on the position of the potentiometer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope10.jpg]] &amp;lt;!-- potentiometer program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a custom value to a program stream======&lt;br /&gt;
&lt;br /&gt;
Custom values are those that do not correspond directly to pins or ports. A custom value can be assigned to a stream object handle by using the [[API_Scope.AddCustom|AddCustom]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the custom channel index 0-31. These act as “slots” in which to store your data. Select a value that is not used by any other custom streams.&lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple custom channels on a single stream. Set this to 1 if you are adding a custom channel to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data.&lt;br /&gt;
 &lt;br /&gt;
To create a single custom stream, we can call the [[API_Scope.AddCustom|AddCustom]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope11.jpg]] &amp;lt;!-- AddCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data for a custom channel cannot come from a digital or analogue channel automatically. Instead we have to manually pass the data to the custom channel. This is done by using the [[API_Scope.SetCustom|SetCustom]] function call. The value passed should be a floating-point real number in the range between 0 and 1 (so to convert a byte variable we would have to divide by the value 255.0.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope13.jpg]] &amp;lt;!-- SetCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program which creates a custom stream, adds custom channel 0 to it, and then continually:&lt;br /&gt;
# tracks the values of two analogue input signals&lt;br /&gt;
# calculates the average between the two readings. &lt;br /&gt;
# sends the data to custom channel 0, which appears on the data recorder in the created stream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope12.jpg]] &amp;lt;!-- custom program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Interacting with streams===&lt;br /&gt;
&lt;br /&gt;
You can change the time span that is being examined by using the drop down on the top-right of the window. Alternatively, you can use your mouse’s scroll wheel. Using the scroll wheel is even more powerful as it allows you to zoom directly over a particular point of interest.&lt;br /&gt;
Stream heights can be modified by dragging the bottom border of the left hand pane for the relevant stream. Colours used for rendering can be modified on the fly directly, by clicking the top square next to the stream name (for the stream background colour), and the bottom square next to the stream name (for the stream waveform/foreground colour)&lt;br /&gt;
&lt;br /&gt;
Hovering your mouse over the stream will show you the time interval between the two peaks that surround the cursor. Note that in simulation mode, this timing is not accurate.&lt;br /&gt;
&lt;br /&gt;
===Packet Decoding===&lt;br /&gt;
&lt;br /&gt;
Communications buses can be decoded to work out what values a bus is sending out and receiving. &lt;br /&gt;
&lt;br /&gt;
Supported Busses:&lt;br /&gt;
*UART (RS232, GSM, GPS, Modbus, Bluetooth, ...) &lt;br /&gt;
*SPI (SPI Master, FAT, EEPROM, RTC, ...) &lt;br /&gt;
*I2C (I2C Master, Accelerometer, EEPROM, RTC, ...) &lt;br /&gt;
&lt;br /&gt;
Packet decoding is available for certain program streams added by components. The button for decoding becomes available when the relevant communication component is added to the panel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--DecodeButton.png--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Decoding is then done by clicking the decode stream button on the appropriate stream. Streams can be decoded regardless of whether the data recorder is running in simulation or Ghost mode.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Image of packet decoding here (SPI master)--&amp;gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Scope&amp;diff=23438</id>
		<title>Using the Data Scope</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Scope&amp;diff=23438"/>
		<updated>2019-05-16T09:55:22Z</updated>

		<summary type="html">&lt;p&gt;DanielM: DanielM moved page Using the Data Scope to Using the Data Recorder&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Using the Data Recorder]]&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23436</id>
		<title>Using the Data Recorder</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23436"/>
		<updated>2019-05-16T09:49:26Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a data recorder ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside Ghost Technology to allow users to monitor signals in real time using In-Circuit-Test. It can also be used in simulation mode, though timing of signals is not accurate when using simulation. In simulation, it allows the user to see the results and values from raw data and components such as dials and measures. This data allows you to monitor the state of the various signals plotted to various channels. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Image of Data Recorder--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The data recorder is very useful for analyzing data as it can accurately display information to identify patterns in the data as well as the speed data is being displayed at. Components such as the DSP range will automatically create their own Data Recorder channels, allowing for very simple yet powerful means of monitoring and debugging the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
====Adding streams====&lt;br /&gt;
&lt;br /&gt;
Streams are separated via two types: user streams and program streams. &lt;br /&gt;
&lt;br /&gt;
=====User streams=====&lt;br /&gt;
&lt;br /&gt;
User streams are simple streams that allow you to easily monitor the value of a digital or analog pin. They can be added by simply clicking the “Add pin trace” button on the data recorder itself and selecting the appropriate digital or analog pin. &lt;br /&gt;
&lt;br /&gt;
This method of adding streams is recommended if you are using Ghost technology (link) to view live pin data from your Matrix hardware.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Image here of Add pin trace button.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Program streams=====&lt;br /&gt;
&lt;br /&gt;
Program streams are added by components or by flowchart icons in your program. For some components, simply adding it to the 2d or 3d panel causes a program stream to appear in the data recorder. These streams are then controlled by the component itself and will be removed automatically when appropriate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Image of program streams added by SPI master.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we will give an example of creating your own program stream using flowchart icons.&lt;br /&gt;
&lt;br /&gt;
======Creating a stream group======&lt;br /&gt;
&lt;br /&gt;
To create a new stream group you first need to create a global “Handle” type variable to store the reference to the stream group. This is basically a unique number which used to refer to that specific group of streams in the data recorder. To do this, open the [[Project_Explorer|Project Explorer]] window and select the “Globals” tab. Next, right click the “Variables” portion of the tree view and select “Add New” from the menu. In the “Create a New Variable” dialogue that pops up give the variable a meaningful name such as “DRGroupHandle”, then switch the variable type to “Object handle” and click “OK”. You should then get an Object handle variable appearing in the [[Project_Explorer|Project Explorer]] window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope1.jpg]] &amp;lt;!--Created handle variable called DRGroupHandle--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we need to assign the handle variable with a value by calling the Flowcode API. To do this we add a Simulation Macro (link) icon to the “Main” flowchart. Then we double-click the icon on the flowchart to edit the icon's properties. Inside the icon property window we first need to ensure that the “Functions” tab is selected and then scroll down to the “DataRecorder” section before clicking the + icon to see all the API calls related to the data recorder’s functionality. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope2.jpg]] &amp;lt;!-- List of DataRecorder API functions --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddGroup|AddGroup]] function call creates a new named group of streams on the data recorder. The return value of the function call requires a handle type variable. You should set this to the name of the variable we have created previously (“DRGroupHandle” in this example). Type a name that you want into the parameter field, (such as “Test Group”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3A.jpg]] &amp;lt;!-- Image of AddGroup with variable entered and “Test Group” --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddStream|AddStream]] function call adds a new named stream to the group on the data recorder. The return value of the function call is a handle type variable. We will have to create a new global object handle type variable to store this. This handle must be unique for each single stream so you must use a new object handle variable for every program stream that you create on the data recorder. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope3B.jpg]] &amp;lt;!-- Image of AddStream with DRGroupHandle, DRStreamHandle return --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we run the simulation the new group will be created on the data recorder ready for data to be streamed in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3.jpg]] &amp;lt;!-- flow icons and created stream image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are creating your own Flowcode component, you can move these from the Main macro to the [[Event_Components.Initialise|simulation initialise event]] macro so that the group and stream are created automatically when the component is added to a program. This is the way that components such as the DSP based components add their data to the console window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope4.jpg]] &amp;lt;!-- Ev_initialise image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a group with no valid stream handles will not show up on the data recorder window just to try and avoid potential unnecessary clutter. &lt;br /&gt;
Setting the handle variable to the value of 0 using a [[Calculation_Icon_Properties|Calculation icon]] or calling the [[API_System.DeleteHandle|System -&amp;gt; DeleteHandle]] API call will remove the group or stream from the data recorder window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a digital pin or port to a program stream======&lt;br /&gt;
&lt;br /&gt;
A digital pin or port can be assigned to a stream object handle by using the [[API_Scope.AddPort|AddPort]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the port index where PORTA is 0, PORTB is 1 etc. &lt;br /&gt;
*the BitMask parameter. This is a binary AND mask which selects which bits of the port will be available on the stream. &lt;br /&gt;
*The PackMask parameter. Setting this to 1 will move all the active bits together if necessary. &lt;br /&gt;
*The merge parameter. This allows you to add multiple ports or pins to a single stream. Set this to 1 if you are adding a digital pin or port to an existing stream that already contains data, and you wish to combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single pin (e.g. Port A, Pin 0) with an LED connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope5.jpg]] &amp;lt;!-- AddPort call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to toggle the LED with the signal being replicated on the data recorder. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope6.jpg]] &amp;lt;!-- LED program with data recorder --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To monitor a full port (e.g. Port B)with a LED Array connected, we can call the [[API_Scope.AddPort|AddPort]] function like this. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope7.jpg]] &amp;lt;!-- AddPort full port call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then scale the stream to get the value in the range of 0-1 by calling the [[API_Scope.AddOp|AddOp]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope8.jpg]] &amp;lt;!-- AddOp call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to generate a digital counter on Port B, with the signal being replicated on the data recorder. The [[API_System.ShowHandle|ShowHandle]] function allows the data recorder window to appear automatically without the user having to manually open the window. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope14.jpg]] &amp;lt;!-- digital counter program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding an analogue pin to a program stream======&lt;br /&gt;
&lt;br /&gt;
An analogue pin can be assigned to a stream object handle by using the [[API_Scope.AddAnalog|AddAnalog]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the analogue channel index where An0 is 0, An1 is 1 etc. &lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple analogue signals on a single stream. Set this to 1 if you are adding an analog pin to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data. &lt;br /&gt;
&lt;br /&gt;
To monitor a single analogue pin (e.g. pin An0), with a potentiometer connected, we can call the [[API_Scope.AddAnalog|AddAnalog]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope9.jpg]] &amp;lt;!-- AddAnalog function call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the value of pin An0, based on the position of the potentiometer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope10.jpg]] &amp;lt;!-- potentiometer program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a custom value to a program stream======&lt;br /&gt;
&lt;br /&gt;
Custom values are those that do not correspond directly to pins or ports. A custom value can be assigned to a stream object handle by using the [[API_Scope.AddCustom|AddCustom]] function call. The function requires:&lt;br /&gt;
*the stream object handle, &lt;br /&gt;
*the custom channel index 0-31. These act as “slots” in which to store your data. Select a value that is not used by any other custom streams.&lt;br /&gt;
*the Subtract parameter. This allows you to add or subtract multiple custom channels on a single stream. Set this to 1 if you are adding a custom channel to an existing stream that already contains data, and you wish to subtract the data. Alternatively set it to 0 if you wish to add/combine the data.&lt;br /&gt;
 &lt;br /&gt;
To create a single custom stream, we can call the [[API_Scope.AddCustom|AddCustom]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope11.jpg]] &amp;lt;!-- AddCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data for a custom channel cannot come from a digital or analogue channel automatically. Instead we have to manually pass the data to the custom channel. This is done by using the [[API_Scope.SetCustom|SetCustom]] function call. The value passed should be a floating-point real number in the range between 0 and 1 (so to convert a byte variable we would have to divide by the value 255.0.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope13.jpg]] &amp;lt;!-- SetCustom call --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program which creates a custom stream, adds custom channel 0 to it, and then continually:&lt;br /&gt;
# tracks the values of two analogue input signals&lt;br /&gt;
# calculates the average between the two readings. &lt;br /&gt;
# sends the data to custom channel 0, which appears on the data recorder in the created stream.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope12.jpg]] &amp;lt;!-- custom program image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Interacting with streams===&lt;br /&gt;
&lt;br /&gt;
You can change the time span that is being examined by using the drop down on the top-right of the window. Alternatively, you can use your mouse’s scroll wheel. Using the scroll wheel is even more powerful as it allows you to zoom directly over a particular point of interest.&lt;br /&gt;
Stream heights can be modified by dragging the bottom border of the left hand pane for the relevant stream. Colours used for rendering can be modified on the fly directly, by clicking the top square next to the stream name (for the stream background colour), and the bottom square next to the stream name (for the stream waveform/foreground colour)&lt;br /&gt;
&lt;br /&gt;
Hovering your mouse over the stream will show you the time interval between the two peaks that surround the cursor. Note that in simulation mode, this timing is not accurate.&lt;br /&gt;
&lt;br /&gt;
===Packet Decoding===&lt;br /&gt;
&lt;br /&gt;
Communications buses can be decoded to work out what values a bus is sending out and receiving. &lt;br /&gt;
&lt;br /&gt;
Supported Busses:&lt;br /&gt;
*UART (RS232, GSM, GPS, Modbus, Bluetooth, ...) &lt;br /&gt;
*SPI (SPI Master, FAT, EEPROM, RTC, ...) &lt;br /&gt;
*I2C (I2C Master, Accelerometer, EEPROM, RTC, ...) &lt;br /&gt;
&lt;br /&gt;
Packet decoding is available for certain program streams added by components. The button for decoding becomes available when the relevant communication component is added to the panel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--DecodeButton.png--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Decoding is then done by clicking the decode stream button on the appropriate stream. Streams can be decoded regardless of whether the data recorder is running in simulation or Ghost mode.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Image of packet decoding here (SPI master)--&amp;gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23435</id>
		<title>Using the Data Recorder</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Using_the_Data_Recorder&amp;diff=23435"/>
		<updated>2019-05-16T09:40:41Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a data recorder ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside Ghost Technology to allow users to monitor signals in real time using In-Circuit-Test. It can also be used in simulation mode, though timing of signals is not accurate when using simulation. In simulation, it allows the user to see the results and values from raw data and components such as dials and measures. This data allows you to monitor the state of the various signals plotted to various channels. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Image of Data Recorder--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The data recorder is very useful for analyzing data as it can accurately display information to identify patterns in the data as well as the speed data is being displayed at. Components such as the DSP range will automatically create their own Data Recorder channels, allowing for very simple yet powerful means of monitoring and debugging the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
====Adding streams====&lt;br /&gt;
&lt;br /&gt;
Streams are separated via two types: user streams and program streams. &lt;br /&gt;
&lt;br /&gt;
=====User streams=====&lt;br /&gt;
&lt;br /&gt;
User streams are simple streams that allow you to easily monitor the value of a digital or analog pin. They can be added by simply clicking the “Add pin trace” button on the data recorder itself and selecting the appropriate digital or analog pin. &lt;br /&gt;
&lt;br /&gt;
This method of adding streams is recommended if you are using Ghost technology (link) to view live pin data from your Matrix hardware.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Image here of Add pin trace button.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Program streams=====&lt;br /&gt;
&lt;br /&gt;
Program streams are added by components or by flowchart icons in your program. For some components, simply adding it to the 2d or 3d panel causes a program stream to appear in the data recorder. These streams are then controlled by the component itself and will be removed automatically when appropriate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Image of program streams added by SPI master.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we will give an example of creating your own program stream using flowchart icons.&lt;br /&gt;
&lt;br /&gt;
======Creating a stream group======&lt;br /&gt;
&lt;br /&gt;
To create a new stream group you first need to create a global “Handle” type variable to store the reference to the stream group. This is basically a unique number which used to refer to that specific group of streams in the data recorder. To do this, open the [[Project_Explorer|Project Explorer]] window and select the “Globals” tab. Next, right click the “Variables” portion of the tree view and select “Add New” from the menu. In the “Create a New Variable” dialogue that pops up give the variable a meaningful name such as “DRGroupHandle”, then switch the variable type to “Object handle” and click “OK”. You should then get an Object handle variable appearing in the [[Project_Explorer|Project Explorer]] window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope1.jpg]] &amp;lt;!--Created handle variable called DRGroupHandle--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we need to assign the handle variable with a value by calling the Flowcode API. To do this we add a Simulation Macro (link) icon to the “Main” flowchart. Then we double-click the icon on the flowchart to edit the icon's properties. Inside the icon property window we first need to ensure that the “Functions” tab is selected and then scroll down to the “DataRecorder” section before clicking the + icon to see all the API calls related to the data recorder’s functionality. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope2.jpg]] &amp;lt;!-- List of DataRecorder API functions --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddGroup|AddGroup]] function call creates a new named group of streams on the data recorder. The return value of the function call requires a handle type variable. You should set this to the name of the variable we have created previously (“DRGroupHandle” in this example). Type a name that you want into the parameter field, (such as “Test Group”).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3A.jpg]] &amp;lt;!-- Image of AddGroup with variable entered and “Test Group” --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [[API_Scope.AddStream|AddStream]] function call adds a new named stream to the group on the data recorder. The return value of the function call is a handle type variable. We will have to create a new global object handle type variable to store this. This handle must be unique for each single stream so you must use a new object handle variable for every program stream that you create on the data recorder. &lt;br /&gt;
&lt;br /&gt;
[[File:Scope3B.jpg]] &amp;lt;!-- Image of AddStream with DRGroupHandle, DRStreamHandle return --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When we run the simulation the new group will be created on the data recorder ready for data to be streamed in. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope3.jpg]] &amp;lt;!-- flow icons and created stream image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are creating your own Flowcode component, you can move these from the Main macro to the [[Event_Components.Initialise|simulation initialise event]] macro so that the group and stream are created automatically when the component is added to a program. This is the way that components such as the DSP based components add their data to the console window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope4.jpg]] &amp;lt;!-- Ev_initialise image --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a group with no valid stream handles will not show up on the data recorder window just to try and avoid potential unnecessary clutter. &lt;br /&gt;
Setting the handle variable to the value of 0 using a [[Calculation_Icon_Properties|Calculation icon]] or calling the [[API_System.DeleteHandle|System -&amp;gt; DeleteHandle]] API call will remove the group or stream from the data recorder window. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Adding a digital pin or port to a program stream======&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A digital pin or port can be assigned to a stream object handle by using the [[API_Scope.AddPort|AddPort]] function call. The function requires the stream object handle, the port index where PORTA is 0, PORTB is 1 etc. The BitMask parameter is a binary AND mask which selects which bits of the port will be available on the scope stream. The PackMask parameter will move all the active bits together if necessary. The merge parameter allows you to add multiple ports or pins to a single stream.&lt;br /&gt;
&lt;br /&gt;
To monitor a single pin with a LED connected to port pin A0 we can simply call the [[API_Scope.AddPort|AddPort]] function like this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope5.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to toggle the LED with the signal being replicated on the scope trace.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope6.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To monitor a full port with a LED Array connected to PortB we can simply call the [[API_Scope.AddPort|AddPort]] function like this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope7.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then need to scale the scope channel to get the value in the range of 0-1 by calling the [[API_Scope.AddOp|AddOp]] function like this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope8.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to generate a digital counter on the port with the signal being replicated on the scope trace. The [[API_System.ShowHandle|ShowHandle]] function allows the Scope window to appear automatically without the user having to manually open the Scope window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope14.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Adding an analogue pin to a stream===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An analogue pin can be assigned to a stream object handle by using the [[API_Scope.AddAnalog|AddAnalog]] function call. The function requires the stream object handle, the analogue channel index where AN0 is 0, AN1 is 1 etc. The subtract parameter allows you to add or subtract multiple analogue signals on a single stream.&lt;br /&gt;
&lt;br /&gt;
To monitor a single analogue pin with a potentiometer connected to pin AN0 we can simply call the [[API_Scope.AddAnalog|AddAnalog]] function like this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope9.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the value of an analogue input signal based on the position of the potentiometer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope10.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Adding an custom value to a stream===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A custom value can be assigned to a stream object handle by using the [[API_Scope.AddCustom|AddCustom]] function call. The function requires the stream object handle, the custom channel index 0-31 for each stream handle. The subtract parameter allows you to add or subtract multiple signals on a single stream.&lt;br /&gt;
&lt;br /&gt;
To create a single custom stream we can simply call the [[API_Scope.AddCustom|AddCustom]] function like this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope11.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The data for a custom channel cannot come from a digital or analogue channel automatically so instead we have to manually pass the data to the custom channel.  This is done by using the [[API_Scope.SetCustom|SetCustom]] function call. The value passed should be a floating point real number in the range between 0 and 1 so to convert a byte variable we have to divide by the value 255.0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope13.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a simple program to track the values of two analogue input signals and then calculate and plot the average between the two readings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scope12.jpg]]&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Ghost_Technology&amp;diff=23434</id>
		<title>Ghost Technology</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Ghost_Technology&amp;diff=23434"/>
		<updated>2019-05-14T13:56:22Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is Ghost Technology?==&lt;br /&gt;
&lt;br /&gt;
[[File:Ghost_Overview.png|border|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ghost is a technology which, when combined with Flowcode, provides a revolutionary way of debugging electronic systems. &lt;br /&gt;
Ghost technology provides a real time log of the status of all the pins on the microcontroller while a program is running on the device. The data is viewed on the Flowcode Oscillscope or Data Recorder. We call this ‘In-Circuit-Test’. &lt;br /&gt;
&lt;br /&gt;
It also provides the ability to control the program that is running on the microcontroller from Flowcode itself. You can run, pause, and step through your program and view Ghost data at the same time. View variables, registers and other memory locations. We call this “In-Circuit-Debug”.&lt;br /&gt;
&lt;br /&gt;
When Ghost is combined with the PC-side processing capabilities of Flowcode it provides a very powerful debugging and learning tool. This saves huge amounts of development time - whether you are working at a pin level and getting your first program to work, or whether you are an advanced user wanting to perform a sanity check to make sure communications baud rates are set at the correct speed. &lt;br /&gt;
&lt;br /&gt;
Both analogue and digital data is gathered through Ghost and displayed on the Flowcode Oscilloscope and Data Recorder. For communications busses, decoding overlays for SPI, I2C, and other comms standards are available. Ghost data can also be passed to simulation/SCADA components in Flowcode to provide Human Machine Interface style debug features. &lt;br /&gt;
You can find an example [http://www.matrixtsl.com/ghost here].&lt;br /&gt;
&lt;br /&gt;
Ghost is watching over your hardware! &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==In-Circuit-Test (Pin monitoring)==&lt;br /&gt;
&lt;br /&gt;
In-Circuit-Test (ICT) functionality is a key feature provided by Ghost. It allows monitoring of all the external signals of your target microcontroller by displaying real time signal data on the Oscilloscope or Data Recorder. Signal data corresponding with communication busses can be decoded with the data appearing in a nice formatted way on either the Data Recorder or the Console Window. &lt;br /&gt;
When ICT is enabled or disabled there is no need to re-program the target device. It is not possible to use ICT when Flowcode simulation is running, unless you are running ICD mode (see the section on ICD below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Supported hardware===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Matrix EB006 PIC Multiprogrammer Version 9 &lt;br /&gt;
* Matrix EB091 dsPIC Programmer &lt;br /&gt;
* Matrix Flowkit II ICD tool - Compatible with Arduino and 3rd party hardware.&lt;br /&gt;
* Matrix BL0011 PIC Programmer&lt;br /&gt;
* Matrix BL0032 dsPIC Programmer&lt;br /&gt;
* Matrix BL0036 Raspberry Pi shield&lt;br /&gt;
* Matrix BL0061 ARM Programmer&lt;br /&gt;
* Matrix BL0080 PIC Multiprogrammer&lt;br /&gt;
* Matrix BL0055 Arduino Shield&lt;br /&gt;
* Matrix BL0086 AVR Programmer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Plug your board into your PC and ensure that the correct drivers are installed (found in the Flowcode install directory)&lt;br /&gt;
# Add your chosen pins to the [[Data_Scope | Data Recorder]] or [[Oscilloscope | Oscilloscope]] &lt;br /&gt;
#:[[File:Data_Recorder_Add_Data.png|x150px|border|Adding pins to the Data Recorder]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;[[File:Oscilloscope_Add_Data.png|x150px|border|Adding pins to the Oscilloscope]]&lt;br /&gt;
# Click the Ghost button on the [[Data_Scope | Data Recorder]] or [[Oscilloscope | Oscilloscope]] &lt;br /&gt;
#:[[File:Data_Recorder_Ghost_Button.png|x50px|border|Activate Ghost from the Data Recorder]] &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; [[File:Oscilloscope_Ghost_Button.png|x50px|border|Activate Ghost from the Oscilloscope]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please click [[Data_Scope | here]] to learn more about the Data Recorder&lt;br /&gt;
&lt;br /&gt;
Please click [[Oscilloscope | here]] to learn more about the Oscilloscope&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==In-Circuit-Debug (Remote control of execution)==&lt;br /&gt;
&lt;br /&gt;
In-Circuit-Debug (ICD) allows breakpoints, single stepping, and other simulation features such as the Simulation Debugger to work seamlessly with your program running directly on the target Microcontroller. &lt;br /&gt;
&lt;br /&gt;
When ICD is enabled you must re-program the target device to allow the ghost specific code to be loaded onto the target device. Once the device has been programmed, it will stay in a waiting state until Flowcode signals it to start running. Clicking the simulation run or step buttons in Flowcode will trigger the target device to react accordingly. Clicking the simulation stop button will reset the target device so that it restarts from the very start of the program. When disabling ICD you again need to re-compile and program the device to allow the ghost specific code to be removed from the program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Supported hardware===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Matrix EB006 PIC Multiprogrammer Version 9 &lt;br /&gt;
* Matrix EB064 dsPIC Multiprogrammer Version 2 &lt;br /&gt;
* Matrix EB091 dsPIC Programmer &lt;br /&gt;
* Matrix Flowkit ICD tool - Compatible with MIAC, ECIO, FormulaFlowcode and 3rd party hardware. &lt;br /&gt;
* Matrix Flowkit II ICD tool - Compatible with Arduino and 3rd party hardware.&lt;br /&gt;
* Matrix BL0011 PIC Programmer&lt;br /&gt;
* Matrix BL0032 dsPIC Programmer&lt;br /&gt;
* Matrix BL0036 Raspberry Pi shield&lt;br /&gt;
* Matrix BL0061 ARM Programmer&lt;br /&gt;
* Matrix BL0080 PIC Multiprogrammer&lt;br /&gt;
* Matrix BL0055 Arduino Shield&lt;br /&gt;
* Matrix BL0086 AVR Programmer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Develop your program using Flowcode as normal until you are ready to test the results.&lt;br /&gt;
# With a Ghost-compatible board connected, click on the ICD button on the main toolbar so that the toolbar changes to green&lt;br /&gt;
#:[[File:ICD_green_toolbar.png|border|x70px| Enabling ICD mode]]&lt;br /&gt;
# Click Compile-To-Chip, to send the Ghost code to your device. &lt;br /&gt;
#:[[File:ICD_Compile_To_Chip.png|border|x70px|Sending ICD code to the microcontroller]]&lt;br /&gt;
# Click Play button or Step Into / Step Over to begin execution. &lt;br /&gt;
#:[[File:ICD_Play.png|border|x70px|Starting ICD execution at full speed]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;[[File:ICD_Step_Into.png|border|x70px|Starting ICD execution in step mode]]&lt;br /&gt;
# When you are finished. Click Stop and then the ICD button again, so that the toolbar returns to its original colour. Click Compile-To-Chip again so that the Ghost code is removed from the program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that you can slow down execution speed using the Simulation Debugger window and monitor the values of variables in the same way as when you are using simulation. ICT is also available when running your program via ICD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advanced Ghost Settings==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For advanced users, you can modify certain operating parameters for Ghost in its settings window. If you have a Ghost device plugged into your PC, you can click the double cog icon on the Oscilloscope or Data Recorder, or the Ghost settings icon on the main toolbar to open the Ghost settings.&lt;br /&gt;
&lt;br /&gt;
[[File:Oscilloscope_Ghost_Settings.png|x50px|border|Ghost settings button on Oscilloscope]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;[[File:Data_Recorder_Ghost_Settings.png|x50px|border|Ghost settings button on Data Recorder]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;[[File:Ghost_Options_Main.png|x50px|border|Ghost settings button on main toolbar]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sample masks===&lt;br /&gt;
&lt;br /&gt;
You can set the sample mask that Ghost uses to decide which pins should be recorded. It is recommended for most cases that you leave this set to automatic mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ghost_Auto_Sample.png|border|400px|Automatic sampling mode (recommended)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, if you wish to set the sample mask manually, you can uncheck the box and choose which pins should be sampled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ghost_Manual_Sample.png|border|400px|Manually selecting which pins should be sampled]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===General settings===&lt;br /&gt;
The settings tab controls various aspects of the ICD and ICT functionality.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ghost_Settings_Tab.png|400px|border|General Ghost settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ICT Settings''': Controls the digital and analog sample rates, note that the analogue sample rate is scaled based on the digital sample rate. &lt;br /&gt;
&lt;br /&gt;
'''ICD Settings''': Controls the number of breakpoints, the maximum size of the stack and the communications time-out delay. &lt;br /&gt;
&lt;br /&gt;
'''Flowkit 2 Settings''': Only configurable when you have a FlowKit 2 board connected, these control the two target pins used for ICD communications. These pins cannot be used in your program or you risk ICD communications being unreliable or unavailable. &lt;br /&gt;
&lt;br /&gt;
'''Enable Overflow and Wrap''': This controls what happens if the ICT buffer runs out of memory. &lt;br /&gt;
* Checked: If the ICT buffer runs out of memory then the contents of memory are wiped allowing ICT to continue, you may notice a glitch on your scope traces. &lt;br /&gt;
* Unchecked: If the ICT buffer runs out of memory then ICT mode is automatically switched off, this guarantees that there are no glitches in the data. &lt;br /&gt;
&lt;br /&gt;
'''Auto-activate ICT when running ICD''': This automatically toggles ICT (pin sampling) when ICD is running. Note that there is no other way to make use of the data recorder otherwise, as simulation data is not available in ICD mode.&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:Ghost_Overview.png&amp;diff=23433</id>
		<title>File:Ghost Overview.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:Ghost_Overview.png&amp;diff=23433"/>
		<updated>2019-05-14T13:54:01Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Oscilloscope&amp;diff=23432</id>
		<title>Oscilloscope</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Oscilloscope&amp;diff=23432"/>
		<updated>2019-05-14T13:24:23Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a 4 channel, fully triggering oscilloscope, ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside [[Ghost_Technology|Ghost Technology]] to allow users to monitor signals in real time using [[Ghost_Technology#In-Circuit-Test_.28Pin_monitoring.29 | In-Circuit-Test]]. It can also be used in simulation mode, though timing of signals is not accurate when using simulation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Oscilloscope.jpg|border|800px|Oscilloscope window showing a sine wave]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note that the oscilloscope is not designed for viewing extremely high-speed signals (in the microsecond range) over long time periods. For this type of analysis, we recommend the [[Using_the_Data_Scope|Data Recorder]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How to use==&lt;br /&gt;
&lt;br /&gt;
To setup a channel, simply click the Add data button for a channel, and select the relevant analog or digital, then click ok. When simulation starts, you’ll begin to see data appear on the screen. If you are using Matrix hardware, you can click the Ghost button when simulation is not running in order to view live data from the microcontroller. You can add up to 4 channels simultaneously, and hide existing channels by unchecking the check boxes.&lt;br /&gt;
&lt;br /&gt;
You can drag the arrow that represents the 0V base line for a channel, in order to modify the waveform’s vertical offset. You can also click use the combo-boxes underneath the grid in order to modify the height of channels.&lt;br /&gt;
&lt;br /&gt;
In order to modify the time, use the drop-down combo box on the bottom-left, labelled “Scale”. To tell Flowcode that your board is operating in 3V3 voltage mode, use the checkbox at the top of the window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Triggering==&lt;br /&gt;
&lt;br /&gt;
Triggering allows the view of the data to remain fixed until an event happens. Click “Use Trigger” to activate trigger mode. You will see the data disappear until the trigger is armed. The settings for modifying the trigger behaviour are as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Oscilloscope_Trigger.png|border|x200px|Trigger settings on Oscilloscope]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sweep type''': If set to “Single”, then after firing, the oscilloscope will draw to the right end of the screen and then maintain the image until the trigger is re-armed. If set to “Repeat”, the trigger will remain armed after firing, and after the oscilloscope has drawn to the right end of the screen, re-fire when the event next occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Edge event''': When set to “Rising”, the trigger fires when the selected channel’s waveform passes above the horizontal trigger line (set using the arrow on the right side of the oscilloscope). When set to “Falling”, the trigger fires when the selected channel’s waveform passes below the horizontal trigger line.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Source channel''': This sets the channel that will be used to detect an edge event, and then fire the trigger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Arm''': If this is toggled active, the trigger is armed and will next fire when the edge event next occurs (in “Single” sweep type), or when the edge event next occurs and the oscilloscope has already drawn to the edge of the screen (in “Repeat” sweep type).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can drag the arrow at the bottom of the oscilloscope to the left or right, in order to set where you want the edge event to be displayed once the trigger fires. This allows you to change how much data before or after the edge event you would like to view.&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Ghost_Technology&amp;diff=23431</id>
		<title>Ghost Technology</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Ghost_Technology&amp;diff=23431"/>
		<updated>2019-05-14T13:23:57Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is Ghost Technology?==&lt;br /&gt;
&lt;br /&gt;
Ghost is a technology which, when combined with Flowcode, provides a revolutionary way of debugging electronic systems. &lt;br /&gt;
Ghost technology provides a real time log of the status of all the pins on the microcontroller while a program is running on the device. The data is viewed on the Flowcode Oscillscope or Data Recorder. We call this ‘In-Circuit-Test’. &lt;br /&gt;
&lt;br /&gt;
It also provides the ability to control the program that is running on the microcontroller from Flowcode itself. You can run, pause, and step through your program and view Ghost data at the same time. View variables, registers and other memory locations. We call this “In-Circuit-Debug”.&lt;br /&gt;
&lt;br /&gt;
When Ghost is combined with the PC-side processing capabilities of Flowcode it provides a very powerful debugging and learning tool. This saves huge amounts of development time - whether you are working at a pin level and getting your first program to work, or whether you are an advanced user wanting to perform a sanity check to make sure communications baud rates are set at the correct speed. &lt;br /&gt;
&lt;br /&gt;
Both analogue and digital data is gathered through Ghost and displayed on the Flowcode Oscilloscope and Data Recorder. For communications busses, decoding overlays for SPI, I2C, and other comms standards are available. Ghost data can also be passed to simulation/SCADA components in Flowcode to provide Human Machine Interface style debug features. &lt;br /&gt;
You can find an example [http://www.matrixtsl.com/ghost here].&lt;br /&gt;
&lt;br /&gt;
Ghost is watching over your hardware! &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==In-Circuit-Test (Pin monitoring)==&lt;br /&gt;
&lt;br /&gt;
In-Circuit-Test (ICT) functionality is a key feature provided by Ghost. It allows monitoring of all the external signals of your target microcontroller by displaying real time signal data on the Oscilloscope or Data Recorder. Signal data corresponding with communication busses can be decoded with the data appearing in a nice formatted way on either the Data Recorder or the Console Window. &lt;br /&gt;
When ICT is enabled or disabled there is no need to re-program the target device. It is not possible to use ICT when Flowcode simulation is running, unless you are running ICD mode (see the section on ICD below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Supported hardware===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Matrix EB006 PIC Multiprogrammer Version 9 &lt;br /&gt;
* Matrix EB091 dsPIC Programmer &lt;br /&gt;
* Matrix Flowkit II ICD tool - Compatible with Arduino and 3rd party hardware.&lt;br /&gt;
* Matrix BL0011 PIC Programmer&lt;br /&gt;
* Matrix BL0032 dsPIC Programmer&lt;br /&gt;
* Matrix BL0036 Raspberry Pi shield&lt;br /&gt;
* Matrix BL0061 ARM Programmer&lt;br /&gt;
* Matrix BL0080 PIC Multiprogrammer&lt;br /&gt;
* Matrix BL0055 Arduino Shield&lt;br /&gt;
* Matrix BL0086 AVR Programmer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Plug your board into your PC and ensure that the correct drivers are installed (found in the Flowcode install directory)&lt;br /&gt;
# Add your chosen pins to the [[Data_Scope | Data Recorder]] or [[Oscilloscope | Oscilloscope]] &lt;br /&gt;
#:[[File:Data_Recorder_Add_Data.png|x150px|border|Adding pins to the Data Recorder]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;[[File:Oscilloscope_Add_Data.png|x150px|border|Adding pins to the Oscilloscope]]&lt;br /&gt;
# Click the Ghost button on the [[Data_Scope | Data Recorder]] or [[Oscilloscope | Oscilloscope]] &lt;br /&gt;
#:[[File:Data_Recorder_Ghost_Button.png|x50px|border|Activate Ghost from the Data Recorder]] &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; [[File:Oscilloscope_Ghost_Button.png|x50px|border|Activate Ghost from the Oscilloscope]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please click [[Data_Scope | here]] to learn more about the Data Recorder&lt;br /&gt;
&lt;br /&gt;
Please click [[Oscilloscope | here]] to learn more about the Oscilloscope&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==In-Circuit-Debug (Remote control of execution)==&lt;br /&gt;
&lt;br /&gt;
In-Circuit-Debug (ICD) allows breakpoints, single stepping, and other simulation features such as the Simulation Debugger to work seamlessly with your program running directly on the target Microcontroller. &lt;br /&gt;
&lt;br /&gt;
When ICD is enabled you must re-program the target device to allow the ghost specific code to be loaded onto the target device. Once the device has been programmed, it will stay in a waiting state until Flowcode signals it to start running. Clicking the simulation run or step buttons in Flowcode will trigger the target device to react accordingly. Clicking the simulation stop button will reset the target device so that it restarts from the very start of the program. When disabling ICD you again need to re-compile and program the device to allow the ghost specific code to be removed from the program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Supported hardware===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Matrix EB006 PIC Multiprogrammer Version 9 &lt;br /&gt;
* Matrix EB064 dsPIC Multiprogrammer Version 2 &lt;br /&gt;
* Matrix EB091 dsPIC Programmer &lt;br /&gt;
* Matrix Flowkit ICD tool - Compatible with MIAC, ECIO, FormulaFlowcode and 3rd party hardware. &lt;br /&gt;
* Matrix Flowkit II ICD tool - Compatible with Arduino and 3rd party hardware.&lt;br /&gt;
* Matrix BL0011 PIC Programmer&lt;br /&gt;
* Matrix BL0032 dsPIC Programmer&lt;br /&gt;
* Matrix BL0036 Raspberry Pi shield&lt;br /&gt;
* Matrix BL0061 ARM Programmer&lt;br /&gt;
* Matrix BL0080 PIC Multiprogrammer&lt;br /&gt;
* Matrix BL0055 Arduino Shield&lt;br /&gt;
* Matrix BL0086 AVR Programmer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Develop your program using Flowcode as normal until you are ready to test the results.&lt;br /&gt;
# With a Ghost-compatible board connected, click on the ICD button on the main toolbar so that the toolbar changes to green&lt;br /&gt;
#:[[File:ICD_green_toolbar.png|border|x70px| Enabling ICD mode]]&lt;br /&gt;
# Click Compile-To-Chip, to send the Ghost code to your device. &lt;br /&gt;
#:[[File:ICD_Compile_To_Chip.png|border|x70px|Sending ICD code to the microcontroller]]&lt;br /&gt;
# Click Play button or Step Into / Step Over to begin execution. &lt;br /&gt;
#:[[File:ICD_Play.png|border|x70px|Starting ICD execution at full speed]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;[[File:ICD_Step_Into.png|border|x70px|Starting ICD execution in step mode]]&lt;br /&gt;
# When you are finished. Click Stop and then the ICD button again, so that the toolbar returns to its original colour. Click Compile-To-Chip again so that the Ghost code is removed from the program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that you can slow down execution speed using the Simulation Debugger window and monitor the values of variables in the same way as when you are using simulation. ICT is also available when running your program via ICD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advanced Ghost Settings==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For advanced users, you can modify certain operating parameters for Ghost in its settings window. If you have a Ghost device plugged into your PC, you can click the double cog icon on the Oscilloscope or Data Recorder, or the Ghost settings icon on the main toolbar to open the Ghost settings.&lt;br /&gt;
&lt;br /&gt;
[[File:Oscilloscope_Ghost_Settings.png|x50px|border|Ghost settings button on Oscilloscope]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;[[File:Data_Recorder_Ghost_Settings.png|x50px|border|Ghost settings button on Data Recorder]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;[[File:Ghost_Options_Main.png|x50px|border|Ghost settings button on main toolbar]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sample masks===&lt;br /&gt;
&lt;br /&gt;
You can set the sample mask that Ghost uses to decide which pins should be recorded. It is recommended for most cases that you leave this set to automatic mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ghost_Auto_Sample.png|border|400px|Automatic sampling mode (recommended)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, if you wish to set the sample mask manually, you can uncheck the box and choose which pins should be sampled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ghost_Manual_Sample.png|border|400px|Manually selecting which pins should be sampled]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===General settings===&lt;br /&gt;
The settings tab controls various aspects of the ICD and ICT functionality.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ghost_Settings_Tab.png|400px|border|General Ghost settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ICT Settings''': Controls the digital and analog sample rates, note that the analogue sample rate is scaled based on the digital sample rate. &lt;br /&gt;
&lt;br /&gt;
'''ICD Settings''': Controls the number of breakpoints, the maximum size of the stack and the communications time-out delay. &lt;br /&gt;
&lt;br /&gt;
'''Flowkit 2 Settings''': Only configurable when you have a FlowKit 2 board connected, these control the two target pins used for ICD communications. These pins cannot be used in your program or you risk ICD communications being unreliable or unavailable. &lt;br /&gt;
&lt;br /&gt;
'''Enable Overflow and Wrap''': This controls what happens if the ICT buffer runs out of memory. &lt;br /&gt;
* Checked: If the ICT buffer runs out of memory then the contents of memory are wiped allowing ICT to continue, you may notice a glitch on your scope traces. &lt;br /&gt;
* Unchecked: If the ICT buffer runs out of memory then ICT mode is automatically switched off, this guarantees that there are no glitches in the data. &lt;br /&gt;
&lt;br /&gt;
'''Auto-activate ICT when running ICD''': This automatically toggles ICT (pin sampling) when ICD is running. Note that there is no other way to make use of the data recorder otherwise, as simulation data is not available in ICD mode.&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Ghost_Technology&amp;diff=23430</id>
		<title>Ghost Technology</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Ghost_Technology&amp;diff=23430"/>
		<updated>2019-05-14T13:22:29Z</updated>

		<summary type="html">&lt;p&gt;DanielM: /* How to use */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is Ghost Technology?==&lt;br /&gt;
&lt;br /&gt;
Ghost is a technology which, when combined with Flowcode, provides a revolutionary way of debugging electronic systems. &lt;br /&gt;
Ghost technology provides a real time log of the status of all the pins on the microcontroller while a program is running on the device. The data is viewed on the Flowcode Oscillscope or Data Recorder. We call this ‘In-Circuit-Test’. &lt;br /&gt;
&lt;br /&gt;
It also provides the ability to control the program that is running on the microcontroller from Flowcode itself. You can run, pause, and step through your program and view Ghost data at the same time. View variables, registers and other memory locations. We call this “In-Circuit-Debug”.&lt;br /&gt;
&lt;br /&gt;
When Ghost is combined with the PC-side processing capabilities of Flowcode it provides a very powerful debugging and learning tool. This saves huge amounts of development time - whether you are working at a pin level and getting your first program to work, or whether you are an advanced user wanting to perform a sanity check to make sure communications baud rates are set at the correct speed. &lt;br /&gt;
&lt;br /&gt;
Both analogue and digital data is gathered through Ghost and displayed on the Flowcode Oscilloscope and Data Recorder. For communications busses, decoding overlays for SPI, I2C, and other comms standards are available. Ghost data can also be passed to simulation/SCADA components in Flowcode to provide Human Machine Interface style debug features. &lt;br /&gt;
You can find an example [http://www.matrixtsl.com/ghost here].&lt;br /&gt;
&lt;br /&gt;
Ghost is watching over your hardware! &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==In-Circuit-Test (Pin monitoring)==&lt;br /&gt;
&lt;br /&gt;
In-Circuit-Test (ICT) functionality is a key feature provided by Ghost. It allows monitoring of all the external signals of your target microcontroller by displaying real time signal data on the Oscilloscope or Data Recorder. Signal data corresponding with communication busses can be decoded with the data appearing in a nice formatted way on either the Data Recorder or the Console Window. &lt;br /&gt;
When ICT is enabled or disabled there is no need to re-program the target device. It is not possible to use ICT when Flowcode simulation is running, unless you are running ICD mode (see the section on ICD below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Supported hardware===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Matrix EB006 PIC Multiprogrammer Version 9 &lt;br /&gt;
* Matrix EB091 dsPIC Programmer &lt;br /&gt;
* Matrix Flowkit II ICD tool - Compatible with Arduino and 3rd party hardware.&lt;br /&gt;
* Matrix BL0011 PIC Programmer&lt;br /&gt;
* Matrix BL0032 dsPIC Programmer&lt;br /&gt;
* Matrix BL0036 Raspberry Pi shield&lt;br /&gt;
* Matrix BL0061 ARM Programmer&lt;br /&gt;
* Matrix BL0080 PIC Multiprogrammer&lt;br /&gt;
* Matrix BL0055 Arduino Shield&lt;br /&gt;
* Matrix BL0086 AVR Programmer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Plug your board into your PC and ensure that the correct drivers are installed (found in the Flowcode install directory)&lt;br /&gt;
# Add your chosen pins to the [[Data_Scope | Data Recorder]] or [[Oscilloscope | Oscilloscope]] &lt;br /&gt;
#:[[File:Data_Recorder_Add_Data.png|x150px|border|Adding pins to the Data Recorder]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;[[File:Oscilloscope_Add_Data.png|x150px|border|Adding pins to the Oscilloscope]]&lt;br /&gt;
# Click the Ghost button on the [[Data_Scope | Data Recorder]] or [[Oscilloscope | Oscilloscope]] &lt;br /&gt;
#:[[File:Data_Recorder_Ghost_Button.png|x50px|border|Activate Ghost from the Data Recorder]] &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; [[File:Oscilloscope_Ghost_Button.png|x50px|border|Activate Ghost from the Oscilloscope]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please click [[Data_Scope | here]] to learn more about the Data Recorder&lt;br /&gt;
&lt;br /&gt;
Please click [[Oscilloscope | here]] to learn more about the Oscilloscope&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==In-Circuit-Debug (Remote control of execution)==&lt;br /&gt;
&lt;br /&gt;
In-Circuit-Debug (ICD) allows breakpoints, single stepping, and other simulation features such as the Simulation Debugger to work seamlessly with your program running directly on the target Microcontroller. &lt;br /&gt;
&lt;br /&gt;
When ICD is enabled you must re-program the target device to allow the ghost specific code to be loaded onto the target device. Once the device has been programmed, it will stay in a waiting state until Flowcode signals it to start running. Clicking the simulation run or step buttons in Flowcode will trigger the target device to react accordingly. Clicking the simulation stop button will reset the target device so that it restarts from the very start of the program. When disabling ICD you again need to re-compile and program the device to allow the ghost specific code to be removed from the program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Supported hardware===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Matrix EB006 PIC Multiprogrammer Version 9 &lt;br /&gt;
* Matrix EB064 dsPIC Multiprogrammer Version 2 &lt;br /&gt;
* Matrix EB091 dsPIC Programmer &lt;br /&gt;
* Matrix Flowkit ICD tool - Compatible with MIAC, ECIO, FormulaFlowcode and 3rd party hardware. &lt;br /&gt;
* Matrix Flowkit II ICD tool - Compatible with Arduino and 3rd party hardware.&lt;br /&gt;
* Matrix BL0011 PIC Programmer&lt;br /&gt;
* Matrix BL0032 dsPIC Programmer&lt;br /&gt;
* Matrix BL0036 Raspberry Pi shield&lt;br /&gt;
* Matrix BL0061 ARM Programmer&lt;br /&gt;
* Matrix BL0080 PIC Multiprogrammer&lt;br /&gt;
* Matrix BL0055 Arduino Shield&lt;br /&gt;
* Matrix BL0086 AVR Programmer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to use===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Develop your program using Flowcode as normal until you are ready to test the results.&lt;br /&gt;
# With a Ghost-compatible board connected, click on the ICD button on the main toolbar so that the toolbar changes to green&lt;br /&gt;
#:[[File:ICD_green_toolbar.png|border|x70px| Enabling ICD mode]]&lt;br /&gt;
# Click Compile-To-Chip, to send the Ghost code to your device. &lt;br /&gt;
#:[[File:ICD_Compile_To_Chip.png|border|x70px|Sending ICD code to the microcontroller]]&lt;br /&gt;
# Click Play button or Step Into / Step Over to begin execution. &lt;br /&gt;
#:[[File:ICD_Play.png|border|x70px|Starting ICD execution at full speed]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;[[File:ICD_Step_Into.png|border|x70px|Starting ICD execution in step mode]]&lt;br /&gt;
# When you are finished. Click Stop and then the ICD button again, so that the toolbar returns to its original colour. Click Compile-To-Chip again so that the Ghost code is removed from the program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that you can slow down execution speed using the Simulation Debugger window and monitor the values of variables in the same way as when you are using simulation. ICT is also available when running your program via ICD.&lt;br /&gt;
&lt;br /&gt;
==Advanced Ghost Settings==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For advanced users, you can modify certain operating parameters for Ghost in its settings window. If you have a Ghost device plugged into your PC, you can click the double cog icon on the Oscilloscope or Data Recorder, or the Ghost settings icon on the main toolbar to open the Ghost settings.&lt;br /&gt;
&lt;br /&gt;
[[File:Oscilloscope_Ghost_Settings.png|x50px|border|Ghost settings button on Oscilloscope]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;[[File:Data_Recorder_Ghost_Settings.png|x50px|border|Ghost settings button on Data Recorder]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;[[File:Ghost_Options_Main.png|x50px|border|Ghost settings button on main toolbar]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sample masks===&lt;br /&gt;
&lt;br /&gt;
You can set the sample mask that Ghost uses to decide which pins should be recorded. It is recommended for most cases that you leave this set to automatic mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ghost_Auto_Sample.png|border|400px|Automatic sampling mode (recommended)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, if you wish to set the sample mask manually, you can uncheck the box and choose which pins should be sampled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ghost_Manual_Sample.png|border|400px|Manually selecting which pins should be sampled]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===General settings===&lt;br /&gt;
The settings tab controls various aspects of the ICD and ICT functionality.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Ghost_Settings_Tab.png|400px|border|General Ghost settings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ICT Settings''': Controls the digital and analog sample rates, note that the analogue sample rate is scaled based on the digital sample rate. &lt;br /&gt;
&lt;br /&gt;
'''ICD Settings''': Controls the number of breakpoints, the maximum size of the stack and the communications time-out delay. &lt;br /&gt;
&lt;br /&gt;
'''Flowkit 2 Settings''': Only configurable when you have a FlowKit 2 board connected, these control the two target pins used for ICD communications. These pins cannot be used in your program or you risk ICD communications being unreliable or unavailable. &lt;br /&gt;
&lt;br /&gt;
'''Enable Overflow and Wrap''': This controls what happens if the ICT buffer runs out of memory. &lt;br /&gt;
* Checked: If the ICT buffer runs out of memory then the contents of memory are wiped allowing ICT to continue, you may notice a glitch on your scope traces. &lt;br /&gt;
* Unchecked: If the ICT buffer runs out of memory then ICT mode is automatically switched off, this guarantees that there are no glitches in the data. &lt;br /&gt;
&lt;br /&gt;
'''Auto-activate ICT when running ICD''': This automatically toggles ICT (pin sampling) when ICD is running. Note that there is no other way to make use of the data recorder otherwise, as simulation data is not available in ICD mode.&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Oscilloscope&amp;diff=23429</id>
		<title>Oscilloscope</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Oscilloscope&amp;diff=23429"/>
		<updated>2019-05-14T13:08:46Z</updated>

		<summary type="html">&lt;p&gt;DanielM: /* Triggering */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a 4 channel, fully triggering oscilloscope, ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside [[Ghost_Technology|Ghost Technology]] to allow users to monitor signals in real time using [[Ghost_Technology#In-Circuit-Test_.28Pin_monitoring.29 | In-Circuit-Test]]. It can also be used in simulation mode, though timing of signals is not accurate when using simulation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Oscilloscope.jpg|border|800px|Oscilloscope window showing a sine wave]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note that the oscilloscope is not designed for viewing extremely high-speed signals (in the microsecond range) over long time periods. For this type of analysis, we recommend the [[Using_the_Data_Scope|Data Recorder]].&lt;br /&gt;
&lt;br /&gt;
==How to use==&lt;br /&gt;
&lt;br /&gt;
To setup a channel, simply click the Add data button for a channel, and select the relevant analog or digital, then click ok. When simulation starts, you’ll begin to see data appear on the screen. If you are using Matrix hardware, you can click the Ghost button when simulation is not running in order to view live data from the microcontroller. You can add up to 4 channels simultaneously, and hide existing channels by unchecking the check boxes.&lt;br /&gt;
&lt;br /&gt;
You can drag the arrow that represents the 0V base line for a channel, in order to modify the waveform’s vertical offset. You can also click use the combo-boxes underneath the grid in order to modify the height of channels.&lt;br /&gt;
&lt;br /&gt;
In order to modify the time, use the drop-down combo box on the bottom-left, labelled “Scale”. To tell Flowcode that your board is operating in 3V3 voltage mode, use the checkbox at the top of the window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Triggering==&lt;br /&gt;
&lt;br /&gt;
Triggering allows the view of the data to remain fixed until an event happens. Click “Use Trigger” to activate trigger mode. You will see the data disappear until the trigger is armed. The settings for modifying the trigger behaviour are as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Oscilloscope_Trigger.png|border|x200px|Trigger settings on Oscilloscope]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sweep type''': If set to “Single”, then after firing, the oscilloscope will draw to the right end of the screen and then maintain the image until the trigger is re-armed. If set to “Repeat”, the trigger will remain armed after firing, and after the oscilloscope has drawn to the right end of the screen, re-fire when the event next occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Edge event''': When set to “Rising”, the trigger fires when the selected channel’s waveform passes above the horizontal trigger line (set using the arrow on the right side of the oscilloscope). When set to “Falling”, the trigger fires when the selected channel’s waveform passes below the horizontal trigger line.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Source channel''': This sets the channel that will be used to detect an edge event, and then fire the trigger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Arm''': If this is toggled active, the trigger is armed and will next fire when the edge event next occurs (in “Single” sweep type), or when the edge event next occurs and the oscilloscope has already drawn to the edge of the screen (in “Repeat” sweep type).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can drag the arrow at the bottom of the oscilloscope to the left or right, in order to set where you want the edge event to be displayed once the trigger fires. This allows you to change how much data before or after the edge event you would like to view.&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Oscilloscope&amp;diff=23428</id>
		<title>Oscilloscope</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Oscilloscope&amp;diff=23428"/>
		<updated>2019-05-14T13:08:36Z</updated>

		<summary type="html">&lt;p&gt;DanielM: /* Triggering */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a 4 channel, fully triggering oscilloscope, ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside [[Ghost_Technology|Ghost Technology]] to allow users to monitor signals in real time using [[Ghost_Technology#In-Circuit-Test_.28Pin_monitoring.29 | In-Circuit-Test]]. It can also be used in simulation mode, though timing of signals is not accurate when using simulation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Oscilloscope.jpg|border|800px|Oscilloscope window showing a sine wave]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note that the oscilloscope is not designed for viewing extremely high-speed signals (in the microsecond range) over long time periods. For this type of analysis, we recommend the [[Using_the_Data_Scope|Data Recorder]].&lt;br /&gt;
&lt;br /&gt;
==How to use==&lt;br /&gt;
&lt;br /&gt;
To setup a channel, simply click the Add data button for a channel, and select the relevant analog or digital, then click ok. When simulation starts, you’ll begin to see data appear on the screen. If you are using Matrix hardware, you can click the Ghost button when simulation is not running in order to view live data from the microcontroller. You can add up to 4 channels simultaneously, and hide existing channels by unchecking the check boxes.&lt;br /&gt;
&lt;br /&gt;
You can drag the arrow that represents the 0V base line for a channel, in order to modify the waveform’s vertical offset. You can also click use the combo-boxes underneath the grid in order to modify the height of channels.&lt;br /&gt;
&lt;br /&gt;
In order to modify the time, use the drop-down combo box on the bottom-left, labelled “Scale”. To tell Flowcode that your board is operating in 3V3 voltage mode, use the checkbox at the top of the window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Triggering==&lt;br /&gt;
&lt;br /&gt;
Triggering allows the view of the data to remain fixed until an event happens. Click “Use Trigger” to activate trigger mode. You will see the data disappear until the trigger is armed. The settings for modifying the trigger behaviour are as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Oscilloscope_Trigger.png|border|x200px|Trigger settings on Oscilloscope]]&lt;br /&gt;
&lt;br /&gt;
'''Sweep type''': If set to “Single”, then after firing, the oscilloscope will draw to the right end of the screen and then maintain the image until the trigger is re-armed. If set to “Repeat”, the trigger will remain armed after firing, and after the oscilloscope has drawn to the right end of the screen, re-fire when the event next occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Edge event''': When set to “Rising”, the trigger fires when the selected channel’s waveform passes above the horizontal trigger line (set using the arrow on the right side of the oscilloscope). When set to “Falling”, the trigger fires when the selected channel’s waveform passes below the horizontal trigger line.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Source channel''': This sets the channel that will be used to detect an edge event, and then fire the trigger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Arm''': If this is toggled active, the trigger is armed and will next fire when the edge event next occurs (in “Single” sweep type), or when the edge event next occurs and the oscilloscope has already drawn to the edge of the screen (in “Repeat” sweep type).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can drag the arrow at the bottom of the oscilloscope to the left or right, in order to set where you want the edge event to be displayed once the trigger fires. This allows you to change how much data before or after the edge event you would like to view.&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:Oscilloscope_Trigger.png&amp;diff=23427</id>
		<title>File:Oscilloscope Trigger.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:Oscilloscope_Trigger.png&amp;diff=23427"/>
		<updated>2019-05-14T13:06:38Z</updated>

		<summary type="html">&lt;p&gt;DanielM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Oscilloscope&amp;diff=23426</id>
		<title>Oscilloscope</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Oscilloscope&amp;diff=23426"/>
		<updated>2019-05-14T13:02:51Z</updated>

		<summary type="html">&lt;p&gt;DanielM: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a 4 channel, fully triggering oscilloscope, ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside [[Ghost_Technology|Ghost Technology]] to allow users to monitor signals in real time using [[Ghost_Technology#In-Circuit-Test_.28Pin_monitoring.29 | In-Circuit-Test]]. It can also be used in simulation mode, though timing of signals is not accurate when using simulation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Oscilloscope.jpg|border|800px|Oscilloscope window showing a sine wave]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note that the oscilloscope is not designed for viewing extremely high-speed signals (in the microsecond range) over long time periods. For this type of analysis, we recommend the [[Using_the_Data_Scope|Data Recorder]].&lt;br /&gt;
&lt;br /&gt;
==How to use==&lt;br /&gt;
&lt;br /&gt;
To setup a channel, simply click the Add data button for a channel, and select the relevant analog or digital, then click ok. When simulation starts, you’ll begin to see data appear on the screen. If you are using Matrix hardware, you can click the Ghost button when simulation is not running in order to view live data from the microcontroller. You can add up to 4 channels simultaneously, and hide existing channels by unchecking the check boxes.&lt;br /&gt;
&lt;br /&gt;
You can drag the arrow that represents the 0V base line for a channel, in order to modify the waveform’s vertical offset. You can also click use the combo-boxes underneath the grid in order to modify the height of channels.&lt;br /&gt;
&lt;br /&gt;
In order to modify the time, use the drop-down combo box on the bottom-left, labelled “Scale”. To tell Flowcode that your board is operating in 3V3 voltage mode, use the checkbox at the top of the window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Triggering==&lt;br /&gt;
&lt;br /&gt;
Triggering allows the view of the data to remain fixed until an event happens. Click “Use Trigger” to activate trigger mode. You will see the data disappear until the trigger is armed. The settings for modifying the trigger behaviour are as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sweep type''': If set to “Single”, then after firing, the oscilloscope will draw to the right end of the screen and then maintain the image until the trigger is re-armed. If set to “Repeat”, the trigger will remain armed after firing, and after the oscilloscope has drawn to the right end of the screen, re-fire when the event next occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Edge event''': When set to “Rising”, the trigger fires when the selected channel’s waveform passes above the horizontal trigger line (set using the arrow on the right side of the oscilloscope). When set to “Falling”, the trigger fires when the selected channel’s waveform passes below the horizontal trigger line.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Source channel''': This sets the channel that will be used to detect an edge event, and then fire the trigger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Arm''': If this is toggled active, the trigger is armed and will next fire when the edge event next occurs (in “Single” sweep type), or when the edge event next occurs and the oscilloscope has already drawn to the edge of the screen (in “Repeat” sweep type).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can drag the arrow at the bottom of the oscilloscope to the left or right, in order to set where you want the edge event to be displayed once the trigger fires. This allows you to change how much data before or after the edge event you would like to view.&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Oscilloscope&amp;diff=23425</id>
		<title>Oscilloscope</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Oscilloscope&amp;diff=23425"/>
		<updated>2019-05-14T13:02:42Z</updated>

		<summary type="html">&lt;p&gt;DanielM: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a 4 channel, fully triggering oscilloscope, ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside [[Ghost_Technology|Ghost Technology]] to allow users to monitor signals in real time using [[Ghost_Technology#In-Circuit-Test_.28Pin_monitoring.29 | In-Circuit-Test]]. It can also be used in simulation mode, though timing of signals is not accurate when using simulation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Oscilloscope.jpg|border|300px|Oscilloscope window showing a sine wave]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note that the oscilloscope is not designed for viewing extremely high-speed signals (in the microsecond range) over long time periods. For this type of analysis, we recommend the [[Using_the_Data_Scope|Data Recorder]].&lt;br /&gt;
&lt;br /&gt;
==How to use==&lt;br /&gt;
&lt;br /&gt;
To setup a channel, simply click the Add data button for a channel, and select the relevant analog or digital, then click ok. When simulation starts, you’ll begin to see data appear on the screen. If you are using Matrix hardware, you can click the Ghost button when simulation is not running in order to view live data from the microcontroller. You can add up to 4 channels simultaneously, and hide existing channels by unchecking the check boxes.&lt;br /&gt;
&lt;br /&gt;
You can drag the arrow that represents the 0V base line for a channel, in order to modify the waveform’s vertical offset. You can also click use the combo-boxes underneath the grid in order to modify the height of channels.&lt;br /&gt;
&lt;br /&gt;
In order to modify the time, use the drop-down combo box on the bottom-left, labelled “Scale”. To tell Flowcode that your board is operating in 3V3 voltage mode, use the checkbox at the top of the window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Triggering==&lt;br /&gt;
&lt;br /&gt;
Triggering allows the view of the data to remain fixed until an event happens. Click “Use Trigger” to activate trigger mode. You will see the data disappear until the trigger is armed. The settings for modifying the trigger behaviour are as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sweep type''': If set to “Single”, then after firing, the oscilloscope will draw to the right end of the screen and then maintain the image until the trigger is re-armed. If set to “Repeat”, the trigger will remain armed after firing, and after the oscilloscope has drawn to the right end of the screen, re-fire when the event next occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Edge event''': When set to “Rising”, the trigger fires when the selected channel’s waveform passes above the horizontal trigger line (set using the arrow on the right side of the oscilloscope). When set to “Falling”, the trigger fires when the selected channel’s waveform passes below the horizontal trigger line.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Source channel''': This sets the channel that will be used to detect an edge event, and then fire the trigger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Arm''': If this is toggled active, the trigger is armed and will next fire when the edge event next occurs (in “Single” sweep type), or when the edge event next occurs and the oscilloscope has already drawn to the edge of the screen (in “Repeat” sweep type).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can drag the arrow at the bottom of the oscilloscope to the left or right, in order to set where you want the edge event to be displayed once the trigger fires. This allows you to change how much data before or after the edge event you would like to view.&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Oscilloscope&amp;diff=23424</id>
		<title>Oscilloscope</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Oscilloscope&amp;diff=23424"/>
		<updated>2019-05-14T13:02:27Z</updated>

		<summary type="html">&lt;p&gt;DanielM: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a 4 channel, fully triggering oscilloscope, ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside [[Ghost_Technology|Ghost Technology]] to allow users to monitor signals in real time using [[Ghost_Technology#In-Circuit-Test_.28Pin_monitoring.29 | In-Circuit-Test]]. It can also be used in simulation mode, though timing of signals is not accurate when using simulation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Oscilloscope.jpg|border|x300px|Oscilloscope window showing a sine wave]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note that the oscilloscope is not designed for viewing extremely high-speed signals (in the microsecond range) over long time periods. For this type of analysis, we recommend the [[Using_the_Data_Scope|Data Recorder]].&lt;br /&gt;
&lt;br /&gt;
==How to use==&lt;br /&gt;
&lt;br /&gt;
To setup a channel, simply click the Add data button for a channel, and select the relevant analog or digital, then click ok. When simulation starts, you’ll begin to see data appear on the screen. If you are using Matrix hardware, you can click the Ghost button when simulation is not running in order to view live data from the microcontroller. You can add up to 4 channels simultaneously, and hide existing channels by unchecking the check boxes.&lt;br /&gt;
&lt;br /&gt;
You can drag the arrow that represents the 0V base line for a channel, in order to modify the waveform’s vertical offset. You can also click use the combo-boxes underneath the grid in order to modify the height of channels.&lt;br /&gt;
&lt;br /&gt;
In order to modify the time, use the drop-down combo box on the bottom-left, labelled “Scale”. To tell Flowcode that your board is operating in 3V3 voltage mode, use the checkbox at the top of the window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Triggering==&lt;br /&gt;
&lt;br /&gt;
Triggering allows the view of the data to remain fixed until an event happens. Click “Use Trigger” to activate trigger mode. You will see the data disappear until the trigger is armed. The settings for modifying the trigger behaviour are as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sweep type''': If set to “Single”, then after firing, the oscilloscope will draw to the right end of the screen and then maintain the image until the trigger is re-armed. If set to “Repeat”, the trigger will remain armed after firing, and after the oscilloscope has drawn to the right end of the screen, re-fire when the event next occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Edge event''': When set to “Rising”, the trigger fires when the selected channel’s waveform passes above the horizontal trigger line (set using the arrow on the right side of the oscilloscope). When set to “Falling”, the trigger fires when the selected channel’s waveform passes below the horizontal trigger line.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Source channel''': This sets the channel that will be used to detect an edge event, and then fire the trigger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Arm''': If this is toggled active, the trigger is armed and will next fire when the edge event next occurs (in “Single” sweep type), or when the edge event next occurs and the oscilloscope has already drawn to the edge of the screen (in “Repeat” sweep type).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can drag the arrow at the bottom of the oscilloscope to the left or right, in order to set where you want the edge event to be displayed once the trigger fires. This allows you to change how much data before or after the edge event you would like to view.&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Oscilloscope&amp;diff=23423</id>
		<title>Oscilloscope</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Oscilloscope&amp;diff=23423"/>
		<updated>2019-05-14T13:02:09Z</updated>

		<summary type="html">&lt;p&gt;DanielM: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a 4 channel, fully triggering oscilloscope, ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside [[Ghost_Technology|Ghost Technology]] to allow users to monitor signals in real time using [[Ghost_Technology#In-Circuit-Test_.28Pin_monitoring.29 | In-Circuit-Test]]. It can also be used in simulation mode, though timing of signals is not accurate when using simulation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Oscilloscope.jpg|border|x600px|Oscilloscope window showing a sine wave]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note that the oscilloscope is not designed for viewing extremely high-speed signals (in the microsecond range) over long time periods. For this type of analysis, we recommend the [[Using_the_Data_Scope|Data Recorder]].&lt;br /&gt;
&lt;br /&gt;
==How to use==&lt;br /&gt;
&lt;br /&gt;
To setup a channel, simply click the Add data button for a channel, and select the relevant analog or digital, then click ok. When simulation starts, you’ll begin to see data appear on the screen. If you are using Matrix hardware, you can click the Ghost button when simulation is not running in order to view live data from the microcontroller. You can add up to 4 channels simultaneously, and hide existing channels by unchecking the check boxes.&lt;br /&gt;
&lt;br /&gt;
You can drag the arrow that represents the 0V base line for a channel, in order to modify the waveform’s vertical offset. You can also click use the combo-boxes underneath the grid in order to modify the height of channels.&lt;br /&gt;
&lt;br /&gt;
In order to modify the time, use the drop-down combo box on the bottom-left, labelled “Scale”. To tell Flowcode that your board is operating in 3V3 voltage mode, use the checkbox at the top of the window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Triggering==&lt;br /&gt;
&lt;br /&gt;
Triggering allows the view of the data to remain fixed until an event happens. Click “Use Trigger” to activate trigger mode. You will see the data disappear until the trigger is armed. The settings for modifying the trigger behaviour are as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sweep type''': If set to “Single”, then after firing, the oscilloscope will draw to the right end of the screen and then maintain the image until the trigger is re-armed. If set to “Repeat”, the trigger will remain armed after firing, and after the oscilloscope has drawn to the right end of the screen, re-fire when the event next occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Edge event''': When set to “Rising”, the trigger fires when the selected channel’s waveform passes above the horizontal trigger line (set using the arrow on the right side of the oscilloscope). When set to “Falling”, the trigger fires when the selected channel’s waveform passes below the horizontal trigger line.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Source channel''': This sets the channel that will be used to detect an edge event, and then fire the trigger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Arm''': If this is toggled active, the trigger is armed and will next fire when the edge event next occurs (in “Single” sweep type), or when the edge event next occurs and the oscilloscope has already drawn to the edge of the screen (in “Repeat” sweep type).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can drag the arrow at the bottom of the oscilloscope to the left or right, in order to set where you want the edge event to be displayed once the trigger fires. This allows you to change how much data before or after the edge event you would like to view.&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Oscilloscope&amp;diff=23422</id>
		<title>Oscilloscope</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Oscilloscope&amp;diff=23422"/>
		<updated>2019-05-14T13:01:58Z</updated>

		<summary type="html">&lt;p&gt;DanielM: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Flowcode Help Overview:ToolsViews&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Flowcode includes a 4 channel, fully triggering oscilloscope, ideal for testing your applications in both hardware and simulation. &lt;br /&gt;
&lt;br /&gt;
It works alongside [[Ghost_Technology|Ghost Technology]] to allow users to monitor signals in real time using [[Ghost_Technology#In-Circuit-Test_.28Pin_monitoring.29 | In-Circuit-Test]]. It can also be used in simulation mode, though timing of signals is not accurate when using simulation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Oscilloscope.jpg|border|x800px|Oscilloscope window showing a sine wave]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note that the oscilloscope is not designed for viewing extremely high-speed signals (in the microsecond range) over long time periods. For this type of analysis, we recommend the [[Using_the_Data_Scope|Data Recorder]].&lt;br /&gt;
&lt;br /&gt;
==How to use==&lt;br /&gt;
&lt;br /&gt;
To setup a channel, simply click the Add data button for a channel, and select the relevant analog or digital, then click ok. When simulation starts, you’ll begin to see data appear on the screen. If you are using Matrix hardware, you can click the Ghost button when simulation is not running in order to view live data from the microcontroller. You can add up to 4 channels simultaneously, and hide existing channels by unchecking the check boxes.&lt;br /&gt;
&lt;br /&gt;
You can drag the arrow that represents the 0V base line for a channel, in order to modify the waveform’s vertical offset. You can also click use the combo-boxes underneath the grid in order to modify the height of channels.&lt;br /&gt;
&lt;br /&gt;
In order to modify the time, use the drop-down combo box on the bottom-left, labelled “Scale”. To tell Flowcode that your board is operating in 3V3 voltage mode, use the checkbox at the top of the window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Triggering==&lt;br /&gt;
&lt;br /&gt;
Triggering allows the view of the data to remain fixed until an event happens. Click “Use Trigger” to activate trigger mode. You will see the data disappear until the trigger is armed. The settings for modifying the trigger behaviour are as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sweep type''': If set to “Single”, then after firing, the oscilloscope will draw to the right end of the screen and then maintain the image until the trigger is re-armed. If set to “Repeat”, the trigger will remain armed after firing, and after the oscilloscope has drawn to the right end of the screen, re-fire when the event next occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Edge event''': When set to “Rising”, the trigger fires when the selected channel’s waveform passes above the horizontal trigger line (set using the arrow on the right side of the oscilloscope). When set to “Falling”, the trigger fires when the selected channel’s waveform passes below the horizontal trigger line.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Source channel''': This sets the channel that will be used to detect an edge event, and then fire the trigger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Arm''': If this is toggled active, the trigger is armed and will next fire when the edge event next occurs (in “Single” sweep type), or when the edge event next occurs and the oscilloscope has already drawn to the edge of the screen (in “Repeat” sweep type).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can drag the arrow at the bottom of the oscilloscope to the left or right, in order to set where you want the edge event to be displayed once the trigger fires. This allows you to change how much data before or after the edge event you would like to view.&lt;/div&gt;</summary>
		<author><name>DanielM</name></author>
		
	</entry>
</feed>