<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>4D Systems Forum - Workshop4 - ViSi Environment (Diablo16)</title>
		<link>https://forum.4dsystems.com.au/</link>
		<description />
		<language>en</language>
		<lastBuildDate>Mon, 24 Feb 2020 18:59:44 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>images/misc/rss.png</url>
			<title>4D Systems Forum - Workshop4 - ViSi Environment (Diablo16)</title>
			<link>https://forum.4dsystems.com.au/</link>
		</image>
		<item>
			<title>Accessing my controller via the Internet</title>
			<link>https://forum.4dsystems.com.au/node/71281</link>
			<pubDate>Fri, 21 Feb 2020 01:12:59 GMT</pubDate>
			<description>Hi, 
 
I have a garden irrigation project operating on my Arduino Uno with an uLCD-35DT LCD display. 
What is the best way to operate the irrigation...</description>
			<content:encoded><![CDATA[Hi,<br />
<br />
I have a garden irrigation project operating on my Arduino Uno with an uLCD-35DT LCD display.<br />
What is the best way to operate the irrigation system remotely from my smart phone.<br />
Ideally I would like to access the LCD display from my smart phone and operate the display from my smart phone just as if I was standing in<br />
front of the display. I am not sure if this is possible, if it is possible then I'm not sure how to do this.<br />
Can anyone offer any guidance please?<br />
<br />
I have internet access at home and WiFi set up through my home and shed.<br />
<br />
<br />
<br />
<br />
]]></content:encoded>
			<category domain="https://forum.4dsystems.com.au/node/38">Workshop4 - ViSi Environment (Diablo16)</category>
			<dc:creator>RobC</dc:creator>
			<guid isPermaLink="true">https://forum.4dsystems.com.au/node/71281</guid>
		</item>
		<item>
			<title>Buffered UART</title>
			<link>https://forum.4dsystems.com.au/node/71256</link>
			<pubDate>Tue, 18 Feb 2020 14:00:54 GMT</pubDate>
			<description>Hi 
 
I am at a point in project where I need to optimize my code to get a fastest execution time. 
More precisely, when the user is using a slider...</description>
			<content:encoded><![CDATA[Hi<br />
<br />
I am at a point in project where I need to optimize my code to get a fastest execution time.<br />
More precisely, when the user is using a slider widget, I have some data to send on the serial/UART. Since the user can play quickly with the slider, I need my serial communication to be fast, to prevent lag.<br />
<br />
I have setup my UART to work in buffered mode, thinking it would give me a faster execution.<br />
<br />
Here is what I understood :<br />
- Using normal mode, serout() needs to wait until there is some free space to send the next data.<br />
- Using buffered mode, serout() will fill a circular buffer. When using com_TXbufferHold(OFF), the data in the buffer is automatically sent on the UART.<br />
This mode should execute faster, since I am filling a variable, and not directly the UART register.<br />
<br />
However, trying a buffered and non-buffered code gives me the same execution duration :<br />
<br />

	
	
	

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code" style="height:200;">
// Global Variable
#constant TX_COM_BUFFER_SIZE_ENCODED_FRAME 1024
var TXbuff [TX_COM_BUFFER_SIZE_ENCODED_FRAME];



func main()

[Some inits]

com_Reset();
com_SetBaud(COM0, 39700); // Parameter for the function is Baud/10
com_Init(RXbuff, BACKGROUND_SERIAL_COM_BUFFER_SIZE,0);
com_TXbuffer(TXbuff,TX_COM_BUFFER_SIZE_ENCODED_FRAME*2,0); // Each array cell is 2 bytes</pre>
</div><br />
<br />

	
	
	

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code" style="height:380;">func sendSerialFrame(var cmd, var * dat, var dataLength)

var i := 0;
var checksum := 0;

var tst_start ;
var tst_stop ;


tst_start := sys_T();


// Make sure the previous frame is completely sent (equivalent to while(isDMABusy()) )
while(com_TXcount() &gt; 0) ;


// Tell TXBuffer that we want to fill the buffer, but not send directly
com_TXbufferHold(ON);    <b>// REMOVED WHEN TRYING NON-BUFFERED</b>


// START CODE
serout(SERIAL_COMMUNICATION_START_CODE) ;

// Command (need to add an ESCAPE if required)
if((cmd == SERIAL_COMMUNICATION_START_CODE) | (cmd == SERIAL_COMMUNICATION_STOP_CODE) | (cmd == SERIAL_COMMUNICATION_ESCAPE_CODE))
     serout(SERIAL_COMMUNICATION_ESCAPE_CODE) ;
endif
serout(cmd) ;
checksum := cmd ;


// All data
// Using the same loop, compute the checksum.
// Using a while() is a bit faster than for() !!
while(i&lt;dataLength)
     // If any of these byte needs an ESCAPE, add the ESCAPE to the encoded frame
     if((dat[i] == SERIAL_COMMUNICATION_START_CODE) | (dat[i] == SERIAL_COMMUNICATION_STOP_CODE) | (dat[i] == SERIAL_COMMUNICATION_ESCAPE_CODE))
          serout(SERIAL_COMMUNICATION_ESCAPE_CODE) ;
     endif
     serout(dat[i]) ;

     // The checksum does not take into account the START, STOP and ESCAPE
     checksum := checksum + dat[i] ;
     if(checksum &gt; 255)
          checksum := (checksum - 256) ;
     endif

i++ ;
wend


// Checksum
serout(checksum) ;

// STOP CODE
serout(SERIAL_COMMUNICATION_STOP_CODE) ;

// Release TX buffer : all the data will be sent !
com_TXbufferHold(OFF);   <b>// REMOVED WHEN TRYING NON-BUFFERED</b>

// Display the execution duration
tst_stop := sys_T();
putstrXY(0,0,&quot;Total: &quot;);
putnumXY(50,0, DEC, tst_stop-tst_start);
endfunc</pre>
</div><br />
Is there something I am missing, or misanderstanding ?<br />
My baud is setup for ~400k, 8 bits, No parity. A 512 byte frame should take ~13ms to be sent out.<br />
I know I have a bit of extra commands to encode my frame, but I find it suprising to get a 27ms execution time for sendSerialFrame(), in both buffered and non-buffered.<br />
<br />
]]></content:encoded>
			<category domain="https://forum.4dsystems.com.au/node/38">Workshop4 - ViSi Environment (Diablo16)</category>
			<dc:creator>Vincent44</dc:creator>
			<guid isPermaLink="true">https://forum.4dsystems.com.au/node/71256</guid>
		</item>
		<item>
			<title>Issue with sending a variable to form0</title>
			<link>https://forum.4dsystems.com.au/node/71168</link>
			<pubDate>Sun, 09 Feb 2020 21:02:33 GMT</pubDate>
			<description><![CDATA[Hello, 
 
I have an odd issue that i can not figure out. I'm using a Gen4-uLC-35DCT-CLB with an arduino nano to control an annealer. Everything...]]></description>
			<content:encoded><![CDATA[Hello,<br />
<br />
I have an odd issue that i can not figure out. I'm using a Gen4-uLC-35DCT-CLB with an arduino nano to control an annealer. Everything worked fine until i added a current and voltage sensing circuit. The coil voltage and coil current both fluctuate quite a bit, much more than they did during standalone testing (not using the LCD, used a separate arduino nano and read values through serial monitor). I then inserted a string item on form 4 to help troubleshoot and i got stable values as i did for the standalone testing. Then i inserted a string item on form0 and did not get stable values. So what i know is that the arduino is sending the correct values to the LCD (being that they are displayed on form4 on string items and leddigits as well, see form4 video with green font), but for some reason the values change when sent to form0 (see form0 video with blue font). I've tried changing the index numbers (leddigits3 to leddigits5) with no success. Any suggestions?<br />
<br />
<br />
<br />
here is the section of code that does the writing (full code is attached):<br />
<br />
int c = round(valueC * cMod);<br />
int v = round(valueV * vMod);<br />
genie.WriteStr(0, v);<br />
genie.WriteStr(1, c);<br />
genie.WriteStr(2, v);<br />
genie.WriteStr(3, c);<br />
genie.WriteObject(15, 12, v); //LCD Voltage Update leddigits12 id:15<br />
genie.WriteObject(15, 13, c); //LCD Current Update leddigits13 id:15<br />
genie.WriteObject(15, 8, v); //voltage to form4<br />
genie.WriteObject(15, 9, c); //current to form4<br />
<br />
<br />
Videos:<br />
<br />
form0: <a href="https://www.youtube.com/watch?v=-xF5Y5qM-7U" target="_blank">https://www.youtube.com/watch?v=-xF5Y5qM-7U</a><br />
The values in question are coil current and coil voltage. the values c and v are displayed to the right of the leddigits using WriteStr.<br />
<br />
form4: <a href="https://www.youtube.com/watch?v=ZFgbPhern2Y&amp;feature=youtu.be" target="_blank">https://www.youtube.com/watch?v=ZFgb...ature=youtu.be</a><br />
Voltage is on top and current on bottom. values c and v are also displayed to the right of their corresponding leddigits.]]></content:encoded>
			<category domain="https://forum.4dsystems.com.au/node/38">Workshop4 - ViSi Environment (Diablo16)</category>
			<dc:creator>mattzero</dc:creator>
			<guid isPermaLink="true">https://forum.4dsystems.com.au/node/71168</guid>
		</item>
		<item>
			<title>Custom Digits usage issue</title>
			<link>https://forum.4dsystems.com.au/node/71117</link>
			<pubDate>Tue, 04 Feb 2020 16:56:15 GMT</pubDate>
			<description><![CDATA[Hello, 
 
I am trying to use the custom digits feature without success so far: the initial image with &quot;00&quot; is shown, but ledDigitsDisplay does not...]]></description>
			<content:encoded><![CDATA[Hello,<br />
<br />
I am trying to use the custom digits feature without success so far: the initial image with &quot;00&quot; is shown, but ledDigitsDisplay does not seem to work.<br />
The initial image displayed indicates that the GCI file is likely loaded properly. Extra debug statements also informed me that the loop is actually working, but the display is not updated.<br />
<br />
I am new to Workshop4, so there is probably something obvious I am missing.<br />
<br />
Thanks for your help,<br />
<br />
Worskhop: 4.6.0.20<br />
Display: Gen4-uLCD-32DT<br />
<br />

	
	
	

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code" style="height:176;">hndl := file_LoadImageControl(&quot;count.dat&quot;, &quot;count.gci&quot;, 1);

img_Show(hndl, icount); // show all digits at 0, only do this once

i := 0;
repeat
  ledDigitsDisplay(0, iicount, 0, 2, 1, 36, 0) ;
  i++;
  if ( i &gt; 99 )
    i := 0;
  endif
pause(1000);
forever</pre>
</div><img title="RegDigits.bmp" data-attachmentid="71118" data-align="none" data-size="full" border="0" src="filedata/fetch?id=71118&amp;d=1580834766" class="bbcode-attachment thumbnail" alt="Click image for larger version

Name:	RegDigits.bmp
Views:	38
Size:	81.1 KB
ID:	71118" /><br />
<br />
Attached: full project with BMP file.]]></content:encoded>
			<category domain="https://forum.4dsystems.com.au/node/38">Workshop4 - ViSi Environment (Diablo16)</category>
			<dc:creator>lolitodubateau</dc:creator>
			<guid isPermaLink="true">https://forum.4dsystems.com.au/node/71117</guid>
		</item>
		<item>
			<title>Issues with WINBUTTON function within my Arduino Uno code.</title>
			<link>https://forum.4dsystems.com.au/node/71044</link>
			<pubDate>Mon, 27 Jan 2020 03:04:15 GMT</pubDate>
			<description><![CDATA[Hi, 
I have attached my Arduino code &quot;Sprinkler System R5.ino. 
I cannot attach my Visie Genie project &quot;Sprinkler System R2.4DGenie&quot; project as this...]]></description>
			<content:encoded><![CDATA[Hi,<br />
I have attached my Arduino code &quot;Sprinkler System R5.ino.<br />
I cannot attach my Visie Genie project &quot;Sprinkler System R2.4DGenie&quot; project as this post will not allow the upload of such a file?<br />
<br />
In particular I am referring to Form 2 of the Visie Genie project. This form is especially setup for testing my Arduino code. The Arduino code refers to all of the objects in Form 2.<br />
<br />
I have these defined variable as noted below within the code.<br />
<br />
<span style="color:#e74c3c">int Behind_Lawn_Selected; //Water Behind Lawn button is pressed</span><br />
<span style="color:#e74c3c">int Behind_Garage_Selected; //Water Behind Garage button is pressed</span><br />
<span style="color:#e74c3c">int Retaining_Wall_Selected; //Water Retaining Wall button is pressed</span><br />
<span style="color:#e74c3c">int Front_Lounge_Selected; //Water Front Lounge button is pressed</span><br />
<span style="color:#e74c3c">int Front_Garage_Selected; //Water Front Garage button is pressed</span><br />
<span style="color:#e74c3c">int Pump_Only_Selected; //Start Pump Only button is pressed</span><br />
<br />
In the Arduino code I set these variables depending on which WINBUTTON is selected from the LCD screen, Form 3, an example is below.<br />
<br />
if (Event.reportObject.cmd == GENIE_REPORT_EVENT)<br />
{<br />
if (Event.reportObject.object == GENIE_OBJ_WINBUTTON) // If the Reported Message was from a WINBUTTON<br />
{<br />
if (Event.reportObject.index == 20) // If WINBUTTON with index 20 is selected<br />
{<br />
<span style="color:#ff0000"><b>Behind_Lawn_Selected = 1;</b></span><br />
genie.WriteObject(GENIE_OBJ_LED, 6, 1); // Write Slider0 value to LED Digits 0<br />
genie.WriteObject(GENIE_OBJ_LED, 7, 0);<br />
genie.WriteObject(GENIE_OBJ_LED, 8, 0);<br />
genie.WriteObject(GENIE_OBJ_LED, 9, 0);<br />
genie.WriteObject(GENIE_OBJ_LED, 10, 0);<br />
genie.WriteObject(GENIE_OBJ_LED, 11, 0);<br />
//genie.WriteObject(GENIE_OBJ_LED_DIGITS, 1, 1);<br />
<br />
}<br />
}<br />
}<br />
<br />
You will notice further down in the code I perform a task if <span style="color:#ff0000"><b>Behind_Lawn_Selected == 1; </b></span>the code is below.<br />
<br />
<b><span style="color:#9b59b6">if(Behind_Lawn_Selected == 1)<br />
{<br />
genie.WriteObject(GENIE_OBJ_LED_DIGITS, 1, 1);<br />
//delay(1000);<br />
}</span></b><br />
<br />
Basically this last bit of code highlighted in purple just does not work and I don't know why. Can anyone please assist me.<br />
<br />
If I write this code in purple within the loop of the if (Event.reportObject.index == 20), the code works, but this is not what I need for my programe.<br />
I need to remember within my code that WINBUTTON 20 has been pressed by setting &quot;<span style="color:#ff0000"><b>Behind_Lawn_Selected = 1;&quot; </b></span>and then using that variable throughout my code to perform other<br />
functions.<br />
<br />
Hope my explanation makes sense.]]></content:encoded>
			<category domain="https://forum.4dsystems.com.au/node/38">Workshop4 - ViSi Environment (Diablo16)</category>
			<dc:creator>RobC</dc:creator>
			<guid isPermaLink="true">https://forum.4dsystems.com.au/node/71044</guid>
		</item>
	</channel>
</rss>
