Working with the Propeller in C#
Bobb Fwed
Posts: 1,119
I am very new to C# and I am attempting to make a simple program that parses SPIN code I have and and program a propeller with it.
I am using Visual Studio 2008, C# .NET 3.5 and when I try to add the propellant.dll in "Add Reference" -> "Browse" I get the attached error.
I have never used a DLL. What am I doing wrong?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
I am using Visual Studio 2008, C# .NET 3.5 and when I try to add the propellant.dll in "Add Reference" -> "Browse" I get the attached error.
I have never used a DLL. What am I doing wrong?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
Comments
social.msdn.microsoft.com/Forums/en/Vsexpressvcs/thread/c194f361-afcb-47ac-81e9-8be60cbc25a0
Here is a code sample that I just created. It is very simple and can easily be expanded. All it does is takes a spin file and creates the binary, then it displays the data in a datagrid.
All you have to do is past this in a form and connect the on FormLoad and on FormClose events. Also put the Propellent.dll file on your C: or change your program to reflect your location. I did not have the library which you should have to get a complex program to work.
If you have any questions or you want me to expand this I will do my best.
Jesse
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
Is there some method I am missing that would allow to see if it worked or not?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
I use BradC's BSTC application with System.Diagnostics.Process ....
It compiles and downloads much much faster, but it doesn't provide a .dll .
I parse the output for errors since BSTC also does not provide a return code.
No return code must be a Pascal/Delphi thing [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
Attached is the C# class I use for build and download. I call it with this:
bool noerr = this.builder.runProgram(path, "bstc", bstcOptStr + toolStripBuildToolOptions.Text + " " + toolStripTextBoxBstcLib.Text + " -d " + comport.PortName + " " + file, "Error", textBoxStatus, progressBar);
// builder is an instance of Builder
// I pass a textbox for collecting output and a progressBar for updates.
// the 3rd parameter is the argument set to use when running bstc use options that make sense for you.
Note that starting a program from within a C# program this way may pose a security risk. Use at your own discretion.
Odd, it's supposed to. It certainly used to when I tested it with cygwin (./bstc.exe -blah ; echo $?)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You only ever need two tools in life. If it moves and it shouldn't use Duct Tape. If it does not move and it should use WD40.
There is a provision for checking the return code in Builder.cs if "searchout" is a zero length string.
All the other stuff is there from the days when there was no return code from bstc.
BTW, one can test return codes from windows programs as: application || echo "error"
The "error" is only printed if the application return code is non-zero.
My software works fine on XP and Vista (both 32-bit) computers, but I tried installing it on my friend's Win7 64-bit and it just throws unhandled exceptions. It appears the Propellant DLL can't load.
Any ideas?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
May the road rise to meet you; may the sun shine on your back.
May you create something useful, even if it's just a hack.
re:No ideas? Has anyone used propellant on either Windows 7 or on a 64-bit OS? At least help me narrow down the issue a bit.
Bob I haven't tried it but this article may give you a few tips:
======================================================================================================================
This article provides an overview of the Windows on Windows 64 (WOW64) sub-system and associated techniques that support 32 bit applications under Windows 7 / Vista 64.
The Enterprise, Ultimate and Professional versions of 64 bit Windows 7 also support a 32 bit Windows XP virtual machine, which is available as optional download.
The purpose of this add on, generally referred to as XPM, is to provide an environment that will support legacy hardware and software that will not work under Windows 7. Having tested XPM, I would advise that you only use it as a last resort. It will provide legacy support if you have no other options but, compared to other virtualisation products, performance is disappointing and the default configuration raises a number of security issues.
==========================================================================================================================
Source: www.techsupportalert.com/content/how-windows7-vista64-support-32bit-applications.htm