Welcome to Synthiam!

Program robots using technologies created from industry experts. EZ-Builder is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.
Get Started

France
Asked — Edited
Resolved Resolved by DJ Sures!

I Am Trying To Connect My Bot In An Ezb Plugin

Hello

I'm a french new user and trying to connect my bot which is based on Synbot and SIML Package in an EZB Plugin

I'm using Nugget to include the Syn Package in my solution.

The plugin is working fine without reference to Syn.
With a Windows forms appplication (Not a Plugin) , bot and reference to Syn are working fine.

But when I include reference to Syn Package in the plugin , I get an error :


User-inserted image


Thanks for your help

Here is my code for Plugin

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading.Tasks;
using System.Windows.Forms;
using Syn.Bot;

namespace Plugin_SIML
{
public partial class Mainform : EZ_Builder.UCForms.FormPluginMaster
{
public Mainform()
{
InitializeComponent();
Console.SetOut(new ControlWriter(Textconsole));
}
///
/// This method is called by EZ-Builder when it requests the configuration for your plugin.
/// EZ-Builder will request the configuration when the control is created and when the project is saved.
/// The data set in this configuration will be serialized and saved in the EZ-Builder user's project.
/// Custom data may be stored in the STORAGE dictionary.
///
public override EZ_Builder.Config.Sub.PluginV1 GetConfiguration()
{

return base.GetConfiguration();
}

///
/// This method is called by EZ-Builder when a project is loaded or when the control is added to a project.
/// Set your default data in here!
/// The configuration from the user's project file will be set using this method.
/// *Note: The plugin must call Base.SetConfiguration(cf) in your override. See the example!
/// Also note that this is a good place to ensure all required configuration data exists.
/// In the case of a newer version of your plugin where different configuration data may be required outside of the users configuration file, set it here.
///
public override void SetConfiguration(EZ_Builder.Config.Sub.PluginV1 cf)
{

base.SetConfiguration(cf);
}

///
/// This method is called by EZ-Builder when another control sends a command to this control using the EZ-Script ControlCommand() function.
/// The available ControlCommand() functions for this control should be returned in the GetSupportedControlCommandsMethodsForSlave() override.
///
public override void SendCommand(string windowCommand, params string[] values)
{

base.SendCommand(windowCommand, values);
}

///
/// This method is called by EZ-Builder for the Cheat Sheet to receive all available ControlCommand() syntax for this control.
/// When the ControlCommand() is called for this function, see the SendCommand() override.
///
public override object[] GetSupportedControlCommands()
{

return base.GetSupportedControlCommands();
}

private void button1_Click(object sender, EventArgs e)
{
Console.WriteLine("Test Create Bot");
var simlBot = new Syn.Bot.Siml.SimlBot();
}

private void button2_Click(object sender, EventArgs e)
{
Console.WriteLine("Stop");
}

private void Textconsole_TextChanged(object sender, EventArgs e)
{

}
}
public class ControlWriter : TextWriter
{
private Control textbox;
public ControlWriter(Control textbox)
{
this.textbox = textbox;
}

public override void Write(char value)
{
textbox.Text += value;
}

public override void Write(string value)
{
textbox.Text += value;
}

public override Encoding Encoding
{
get { return Encoding.ASCII; }
}
}
}

#7  
@DJ,

I had the same problem sometime ago:
EZ-Builder + plugin + Component

After struggling for a few days, i moved the code to an external App to keep going.
Later i developed a plugin framework to test the dynamic load like you do in EZ-Builder and i couldn't reproduce the problem.
So far only happens with EZ-Builder.

My solution to help troubleshooting:

AssemblyLoadTest.zip

1) Plugin
your smtp client (I added a button to do the test)

2) Component
Simple class with a Regex method.
Note: i had problems with another class but i can't remember.

User-inserted image
Synthiam
#8  
It appears to be an issue when loading portable libraries. I added a second library that is loaded to your example, which works. Try this: AssemblyLoadTest-NoCrash.zip
#9  
Yes it works.

Unfortunately PCL assemblies are becoming more frequent, some of them don't offer a non PCL version.

DJ did you tried the Plugin+PCL issue in debug Mode (EZ-Builder code open in the visual studio) ?

If you want to dig the issue, you can try to call the plugin early as possible in your EZ-Builder code to confirm if the problem surfaces immediately or after loading other assemblies.
Synthiam
#10  
Figured it out. I'll release an update this evening. Thanks for your help!
Synthiam
#11  
Can you close this assistance thread? The latest EZ-Builder resolves this issue.