<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[CANNY logic forum — Timing when setting values of one frame based on a value in another]]></title>
	<link rel="self" href="https://forum.cannylogic.com/extern.php?action=feed&amp;tid=54&amp;type=atom" />
	<updated>2022-04-14T16:59:53Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.cannylogic.com/viewtopic.php?id=54</id>
		<entry>
			<title type="html"><![CDATA[Re: Timing when setting values of one frame based on a value in another]]></title>
			<link rel="alternate" href="https://forum.cannylogic.com/viewtopic.php?pid=970#p970" />
			<content type="html"><![CDATA[<p>You are welcome!<br />Then CAN GW is enabled, the messages selection / altering / modifying / retransmission is performed by it asynchronously, at the moment when the message arrived, regardless of the current diagram step.</p><p>By default, the diagram receives via CAN-driver&#039;s registers each message that was caught by any active CAN GW selector . But you can disable this through the CAN GW driver&#039;s Tracing mode registers.<br />Please: <a href="https://cannylogic.com/docs/c72duo/cangateway/#sec--c72duo-cangateway-operation_diagram" target="_blank">https://cannylogic.com/docs/c72duo/cang … on_diagram</a></p>]]></content>
			<author>
				<name><![CDATA[Konstantin, CANNY logic]]></name>
				<uri>https://forum.cannylogic.com/profile.php?id=2</uri>
			</author>
			<updated>2022-04-14T16:59:53Z</updated>
			<id>https://forum.cannylogic.com/viewtopic.php?pid=970#p970</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Timing when setting values of one frame based on a value in another]]></title>
			<link rel="alternate" href="https://forum.cannylogic.com/viewtopic.php?pid=966#p966" />
			<content type="html"><![CDATA[<p>Thanks Konstantin. Can you tell me more about what you mean when you say the CAN gateway runs asynchronously to the diagram?</p><p>I guess the main problem I&#039;m having is that I am unclear about when a message is processed in the diagram and when it isn&#039;t.</p><p>Is it possible to have the message sent through from CAN0 to CAN1 unmodified, but still use the diagram to inspect (but not change) the data in the message?</p>]]></content>
			<author>
				<name><![CDATA[nicedream]]></name>
				<uri>https://forum.cannylogic.com/profile.php?id=302</uri>
			</author>
			<updated>2022-04-11T02:14:42Z</updated>
			<id>https://forum.cannylogic.com/viewtopic.php?pid=966#p966</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Timing when setting values of one frame based on a value in another]]></title>
			<link rel="alternate" href="https://forum.cannylogic.com/viewtopic.php?pid=965#p965" />
			<content type="html"><![CDATA[<p>As for me, Option 2 &amp; Option 3 sounds great.<br />For such long sending intervals, the overhead can be neglected. Moreover, CAN gateway driver running asynchronously to the diagram. So I personally prefer Option 2 as a clearer solution - no need to disturb the CAN GW driver for nothing.</p>]]></content>
			<author>
				<name><![CDATA[Konstantin, CANNY logic]]></name>
				<uri>https://forum.cannylogic.com/profile.php?id=2</uri>
			</author>
			<updated>2022-04-05T17:40:54Z</updated>
			<id>https://forum.cannylogic.com/viewtopic.php?pid=965#p965</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Timing when setting values of one frame based on a value in another]]></title>
			<link rel="alternate" href="https://forum.cannylogic.com/viewtopic.php?pid=964#p964" />
			<content type="html"><![CDATA[<p>When implementing a CAN gateway, is there a good method or general &quot;best practice&quot; for setting a value in one CAN data frame based on a value in a different frame, when those two frames are sent at different intervals?</p><br /><p>Here&#039;s a simplified example to demonstrate what I mean:</p><p>A data frame (CAN ID 001) is sent through the gateway at an interval of once per second.<br />A different frame (CAN ID 005) is sent through the gateway once every 5 seconds.<br />(The CAN IDs&nbsp; aren&#039;t real, I just made them to correspond to the intervals)</p><br /><p>When a bit is set to 1 on frame 001, I want to set a bit in 005 to 1.<br />What&#039;s the best way to implement this?</p><br /><p>When the 001 frame comes through the gateway I could do the following:<br /><strong>Option 1</strong>: Generate a new 005 data frame - It seems like this would not be ideal, because I don&#039;t know what the other values in that frame should be.&nbsp; I could set them all to 0, but that seems like a bad idea.</p><p><strong>Option 2</strong>: Constantly store the most recent values that come through in the 005 frames, so that if I need to generate a new frame then I have the data I need to populate it.&nbsp; This seems like it would work, but might be a lot of overhead to constantly read and store those values.</p><p><strong>Option 3</strong>: When the bit is set or unset on the 001 frame, set a flag that enables or disables the rewrite rule on the 005 frame.&nbsp; It seems like this would be the best and cleanest option.</p><br /><p>Am I on the right track with this?&nbsp; Or is there a better way that I&#039;m missing?</p>]]></content>
			<author>
				<name><![CDATA[nicedream]]></name>
				<uri>https://forum.cannylogic.com/profile.php?id=302</uri>
			</author>
			<updated>2022-04-05T15:01:16Z</updated>
			<id>https://forum.cannylogic.com/viewtopic.php?pid=964#p964</id>
		</entry>
</feed>
