On 9/10/07, Richard Reynolds <[EMAIL PROTECTED]> wrote:
>
> I have my devils advocate hat on today just cause I do!!!
>
> On Mon, 10 Sep 2007, Paul G. Allen wrote:
> > This afternoon my boss said we need a new test utility and he'd prefer
> > it to be written using C# and .NET. Some of his reasons were as follows:
> >
> > 1. That we have to support Windows (mainly for customers)
> .NET is a good choice for winhozed support
>
> > 2. As compared to Java, the GUIs work better and in general look better.
> Lets face it! they DO!
>
> > 3. It's a common technology.
> cant argue there, mostly because you didnt really define common, so I cant
> argue.
>
> > 4. It seems to be the best technology set for Windows applications
> > requiring a GUI.
> again this is very true!
>
> > I prefer not to use C# and .NET at all. I don't like programming on
> > Windows in the first place and have never used C# or .NET, but aside
> > from that I prefer
> I prefer not to have to rely on others to get there jobs done so I can do
> mine,
> but here I sit waiting for someone else ....
>
>
> > open standards,
> when the $ comes down on the current world "open standards" means nothing!
> your
> boss can have a superior looking product in less time/money then tuff
> stuff to
> java
>
> >non-restrictive (or less restrictive) licensing,
> your reading the wrong side of the card.
>
>
> > and technologies that allow the easiest porting from one
> > platform to another.
> which platform, if you have vb2.0 code you can port it into .NET if you
> have
> .NET you can port it onto .... or you can use the sorry excuse for a java
> interpritor that is available for windows in the entire time ive been
> looking
> there are only 3 or 4 tools that were designed for java and work just as
> well in
> linux and windows mostly because they have been ported the right way, not
> automatically or trusting some "magic interpretor"
>
> >I do believe in using the best tool for the job.
> nah you believe in using tools you are acustom to. Or you would have known
> .NET
> was the best tool for the job... which is writing a tool for M$ winhozed
>
> > Portability doesn't seem to be a concern to anyone because "Everyone
> > [customers] is using Windows and will be for some time."
> Today I hate M$ winders but damn near everyone is using it!!!
>
>
> > Long story short, he said if I can come up with valid reasons why we
> > should use Java instead of C# and .NET, he'd reconsider his position.
> the long story sounds like a LOT of fun!!!
>
>
> > Why should a developer use Java instead of C# and .NET?
> when there target is NOT winhozed!
>
> > Does .NET support GPIB or HPIB capable instrumentation?
> YES
>
> > Are there licensing issues we should be concerned about if we write an
> application that we will
> > then be giving or even selling to our customers?
>
> only a few, none of these are really avoided with your open standards, if
> you
> steal code your not supposed to or if you steal the compiler, then there
> are
> license issues. otherwise if you OWN the compiler and its not the student
> version (that has a limited license) then there are no m$ license issues.
>
>
> > TIA,
> You asked for it
>
>
> Richard Reynolds
> [EMAIL PROTECTED]
>
>
> --
> [email protected]
> http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
>
Pretty much all true. I do mostly embedded programming these days, but run
my own scripting test system using XML written in C#, as well as make all
the customer and engineering GUIs. If you want an easy tool, with TONs of
resources out there to rapidly develop a GUI then it's the way to go. I'm
able to leverage the ease of development to make my embedded work more
flexible.
Now I keep my Linux Box next to my windows box, but mostly these days linux
is for cadence (man I hate cadence), PERL scripts, and my apache intranet
site. I think the only time I ever developed a GUI for linux using Java was
back in college, but I don't remember it ever being as easy.
I will admit that from my perspective Java has gained some traction as a web
language for fancy interactive sites, and more feature rich situations.
Didn't really gain that much traction on the desktop, and really M$ did
steal all the good features from Java, put them into C# (that's the only
reason I "KNOW" C# is because I learned Java in college and it's the same
basically), and as far as I'm concerned did a good job. I'm also not
convinced that Java will leave any lasting impression on the embedded space,
but we'll see.
Personally the publish feature is my favorite. Nothing like having my
applications get automatically updated company wide automatically.
-Tom
p.s. I included some code I got and use from NI for labview. Just inherit
the class and use the inherited write function to write a command like
"*idn?" to get the ID string. Something like below for an Agilent E3633A
power Supply. You'll need the DLL that comes with any GPIB card or USB
adapter (LangInt.DLL)
public bool SetVoltage(float voltvalue, out string responsestring)
{
if ((voltvalue < 0) || (voltvalue > 8.0)) //voltage must be
between 0V and 8V
{
responsestring = "Invalid voltage Setting";
return false;
}
return WriteCommand("VOLT " + Convert.ToString(voltvalue), out
responsestring);
}
public bool SetCurrent(float currvalue, out string responsestring)
{
if ((currvalue < 0) || (currvalue > 5.0)) //current must be
between 1A and 10A
{
responsestring = "Invalid current Setting";
return false;
}
return WriteCommand("CURR " + Convert.ToString(currvalue), out
responsestring);
}
public bool OutOn(out string responsestring)
{
return WriteCommand("OUTP:ON ", out responsestring);
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using NationalInstruments.NI4882;
namespace GPIBCommLibrary
{
public class GPIBCommDLL
{
#region GPIB_VARIABLES
private LangInt gpib_li;
private GpibConstants gpib_c;
private static string[] gpib_ErrorMnemonic = { "EDVR", "ECIC", "ENOL",
"EADR", "EARG", "ESAC",
"EABO", "ENEB", "EDMA",
"", "EOIP", "ECAP", "EFSO", "",
"EBUS", "ESTB", "ESRQ",
"", "", "", "ETAB" };
private int gpib_device; //device handle
private int gpib_address; //GPIB Primary Address for HP8164A
private int gpib_boardindex;
private int gpib_timeout; //timeout value
private int gpib_eot;
private int gpib_eos;
#endregion
private bool connected = false;
public GPIBCommDLL(int boardindex, int primaryaddress, int timeout, int
eot, int eos)
{
gpib_li = new LangInt();
gpib_c = new GpibConstants();
gpib_boardindex = boardindex;
gpib_address = primaryaddress;
gpib_timeout = timeout;
gpib_eot = eot;
gpib_eos = eos;
}
public GPIBCommDLL(int deviceaddress)
{
gpib_li = new LangInt();
gpib_c = new GpibConstants();
gpib_boardindex = 0;
gpib_address = deviceaddress;
gpib_timeout = gpib_c.T10s;
gpib_eot = 1;
gpib_eos = 0;
}
public void Connect()
{
if (!connected)
{
gpib_device = gpib_li.ibdev(gpib_boardindex, gpib_address, 0,
gpib_timeout, gpib_eot, gpib_eos);
gpib_li.ibclr(gpib_device);
if ((gpib_li.ibsta & gpib_c.ERR) != 0)
throw new System.Exception("Unable to clear device"); //
throw an error
connected = true;
}
}
public bool WriteCommand(string commandstring, out string
responsestring)
{
try
{
Connect();
gpib_li.ibwrt(gpib_device, commandstring, commandstring.Length);
if ((gpib_li.ibsta & gpib_c.ERR) != 0)
throw new System.Exception("Unable to write to Laser
Source"); // throw an error
if (commandstring.Contains("?"))
{
gpib_li.ibrd(gpib_device, out responsestring, 100);
if ((gpib_li.ibsta & gpib_c.ERR) != 0)
throw new System.Exception("Unable to read data from
Laser Source"); // throw an error
}
else
responsestring = "";
return true;
}
catch (System.Exception caught)
{
try
{
responsestring = ("Error: " + caught.Message +
"ibsta = " + gpib_li.ibsta +
"iberr = " + gpib_li.iberr +
gpib_ErrorMnemonic[gpib_li.iberr]);
//error code
}
catch (IndexOutOfRangeException ex)
{
responsestring = "Error: Invalid GPIB Error code!";
}
return false;
}
finally
{
gpib_li.ibonl(gpib_boardindex, 0);
gpib_li.Dispose();
}
}
public bool WriteCommand(XmlNode comNode, out string responseString)
{
string commandString = "";
bool foundCommand = false;
/*if (!(comNode.Name == "WriteGPIBCommand"))
throw new ApplicationException("Bizzare XML Error");*/
foreach (XmlAttribute xa in comNode.Attributes)
{
switch (xa.Name)
{
case "CommandString":
commandString = xa.Value;
foundCommand = true;
break;
default:
throw new ApplicationException("Bad XML Parameter in
WriteGPIBCommand");
}
}
if (foundCommand)
return WriteCommand(commandString, out responseString);
else
throw new ApplicationException("Missing Parameter in
WriteGPIBCommand");
return false;
}
}
}
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list