Make an ARC Skill

Example: Dependencies, Files and Sub Folders

Your plugin may require dependencies, such as images, fonts or other various files.

DLL Files There are two types of DLL files, managed and unmanaged. A managed DLL is the type that can be added as a resource in the .Net project. The unmanaged DLL is a C or C++ library which is used with Interop calls. If you use either of these, you will be aware of which one is being used.

Any managed DLL file that was added as a resource to your project, should be included to be copied as a resource during compile time. Using managed DLL files does not require any path specifications in your code, as the assembly will be loaded when needed. Visual Studio will take care of copying the file, long as it is marked to be copied, during compile, into the root plugin folder. You should not need to worry about managed DLL location, as visual studio will take care of it, but it must be in the same folder as your plugin DLL.

The unmanaged DLL usage is a different story. When your plugin references an unmanaged DLL, it also specifies the path. If the path is not specified in the interop decleration, the default directory of your plugin is assumed. The unmanaged DLL must be added to your project as a content type, and included to be copied when compiled. This is because unmanaged DLL files are not added as resources in .Net Visual Studio projects, and therefore you must take care of specifying the file to be copied yourself, during compile time. This is easy by simply adding the file to the project as content, and selecting Copy Always from it's property settings.

The source code of an Example Project of using both unmanaged and managed DLL files can be found in the Oculus Rift Camera plugin, here: http://www.ez-robot.com/EZ-Builder/Plugins/view/59

Files & Sub Folders If your plugin requires to read files from the plugin folder, here's how you can get the path to the plugin root folder, by combing the guid and windows environment settings for the public path. The location of the plugin folder in the Public Documents is defined by the Windows Operating System. The Public Documents and plugin path is assembled with the method EZ_Builder.Constants.PLUGINS_FOLDER, as seen in code examples below.

This code example combines the user's public ARC plugin folder, that comes from the windows environment settings, the guid and the filename.


using System.IO;

string OculusRift_Fx_File = EZ_Builder.Common.CombinePath(
        EZ_Builder.Constants.PLUGINS_FOLDER,
        _cf._pluginGUID,
        "OculusRift.fx");

if (!File.Exists(OculusRift_Fx_File)) {

    MessageBox.Show("Unable to find the OculusRift.fx file that should have installed with this plugin. Cancelling");

    return;
}

So if you have a fonts sub folder in the plugin folder, or some sub in the plugin folder, you can do this...


      string FontFile = EZ_Builder.Common.CombinePath(
        EZ_Builder.Constants.PLUGINS_FOLDER,
        _cf._pluginGUID,
        "Fonts",
        "SomeFont.ttf");

Or to read the files from a sub folder of the plug directory...


      using System.IO;

      string fontFolder = EZ_Builder.Common.CombinePath(
        EZ_Builder.Constants.PLUGINS_FOLDER,
        _cf._pluginGUID,
        "Fonts");

      foreach (string fontFile in Directory.GetFiles(fontFolder)) {

            Console.WriteLine("File: {0}", fontFile);
      }        


ARC Pro

Upgrade to ARC Pro

Synthiam ARC Pro is a new tool that will help unleash your creativity with programming robots in just seconds!

#17  

The error cannot read the COM file, I downloaded it and when I follow the instructions, I get an error, while other files read normally. .

User-inserted image

#18   — Edited

sorry for me but i tried many different ways but still show the error,I couldn't find EZ_B.dll file even though I downloaded it

PRO
Synthiam
#19  

None of the required references are in your list. Please follow the tutorial. It explains exactly how to click the browse button and navigate to the folder and select the files.

#20  

Sorry, but the reason I can't reference is because there is no file in the EZ_B folder and there is an error : this folder is empty , I am trying to solve it. I would like to thank DJ sure for answering my superfluous questions and I'm sorry for bothering you

Australia
#21   — Edited

I need to playback 5 Serial Bus servos in sequence.

PRO
Synthiam
#22   — Edited

What protocol is it? A "serial bus" is a generic term for anything using a UART that's chained together sharing the same RX line. Also, why did you add a photo with the question text added in your response?

Are you planning on making a skill control to do this? You wrote the question in the skill control thread in a comment - I'd like to make sure your question is in the right place to help you out.

To begin, I would recommend starting with servo Script control so you can make the serial bus protocol work - then consider making a skill control only if you're planning on distributing the effort to others: https://synthiam.com/Products/Controls/Scripting/Servo-Script-19068

#23  

He seems rather demanding as well.  I guess he needs the benefit of the doubt as English may not be his native language....

#24   — Edited

I have installed all the software dependencies and still ARC does not detect that I have Visual Studio installed. OS is Windows 10, .NET 4.8 or newer, Visual Studio Community 2019.