Welcome Guest! To enable all features please Login or Register.
Options
Go to last post Go to first unread
francis.thibault24@gmail.com  
#1 Posted : Friday, April 03, 2015 10:57:24 AM(UTC)
francis.thibault24@gmail.com

Rank: Newbie

Groups: BetaUser, Registered
Joined: 4/2/2015(UTC)
Posts: 8
Canada
Location: Montreal

I try to display the string text from the Output_Text and it does not appear on the Add Output_Text variable. Any hints?

This is the code:

<Nodes>
<Node>
<UniqueID>2e6f59a5-23cf-4f48-bb06-edec1b1426ce</UniqueID>
<AssemblyType>Embrio.NodeEngine.AgentController.Nodes.AgentControllerCustomArduinoNode</AssemblyType>
<NodeType>Custom Arduino Node</NodeType>
<UserDefinedName></UserDefinedName>
<Description>A node that lets you write any Arduino code to interact with the Arduino hardware. Can be both an input and output.</Description>
<NodeColor>201,204,227,255</NodeColor>
<X>0</X>
<Y>0</Y>
<Width>380</Width>
<IncludeCode>#include &lt;dht11.h&gt;</IncludeCode>
<DeclerationCode>#define dht_dpin 2
dht DHT;</DeclerationCode>
<SetupCode></SetupCode>
<ImageName>arduino.png</ImageName>
<InfoURL></InfoURL>
<CodeDefinitions>
<CodeDefinition>
<UpdateCondition>EveryUpdate</UpdateCondition>
<Code>DHT.read11(dht_dpin);
String Output_Text = ToString(DHT.temperature);
</Code>
<UniqueID>1798ed00-a17c-4b67-ae60-f0cce0966249</UniqueID>
</CodeDefinition>
</CodeDefinitions>
<Inputs></Inputs>
<Outputs>
<Output>
<UniqueID>f2e3b8b8-ed29-43ca-9fee-5820d4924aaa</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Text</DefaultName>
<CustomName>Output_Text</CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>String</TypeName>
<IsOutsideConnection>True</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.StringNodeOutput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>True</IsUserAdded>
<MaxLength>10</MaxLength>
</Output>
</Outputs>
</Node>
</Nodes>

Thanks.
EmbrioAdmin  
#2 Posted : Friday, April 03, 2015 11:01:38 AM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 36 time(s) in 33 post(s)
I see two things. Rename the output to just "Text", and remove the "String " from your code. Using Output_Name in code is so that Embrio knows that you're trying to access an input or an output, you could have both an input and output with the same name.

Try pasting this node:
francis.thibault24@gmail.com  
#3 Posted : Friday, April 03, 2015 11:07:32 AM(UTC)
francis.thibault24@gmail.com

Rank: Newbie

Groups: BetaUser, Registered
Joined: 4/2/2015(UTC)
Posts: 8
Canada
Location: Montreal

If a remove the String from my code and only use Text, I got the following error from the compiler: 'Text' was not declared in the scope
EmbrioAdmin  
#4 Posted : Friday, April 03, 2015 11:10:25 AM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 36 time(s) in 33 post(s)
The full line should be:

Output_Text = ToString(DHT.temperature);

The "Output_" part tells Embrio you're trying to access a node output, the rest is the name of the output you're trying to target.

Click on the "spoiler" tag in the last post, I hid the xml in there to keep things tidy.
EmbrioAdmin  
#5 Posted : Friday, April 03, 2015 11:12:36 AM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 36 time(s) in 33 post(s)
Also, you should probably change the refresh rate (in the bottom right of the node screen) to something lower, sending text over the serial port is a little bit slow. Your node is set to update 32 times per second, which might be too much.
francis.thibault24@gmail.com  
#6 Posted : Friday, April 03, 2015 11:14:24 AM(UTC)
francis.thibault24@gmail.com

Rank: Newbie

Groups: BetaUser, Registered
Joined: 4/2/2015(UTC)
Posts: 8
Canada
Location: Montreal

Ok it works now, thanks for the advice.
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error