There's a better solution for this coming in the next release. The data will
be automatically converted as part of our "SmartEU" functionality. I'm
afraid what Acra has suggested is your best option at the moment. We do have
a sscanf function but it's broken in the current release.
The solution that I've written is dependent, however, on you providing some
information with your UART card. You can't be using the "snarfing" aspect of
the card. If you send your XidML file to me at kathy_at_iads-soft_dot_com I
can let you know if it'll work ( email obscured to prevent spamming ).
Also I'm looking for beta-testers for this software since I don't have a
UART card of my own. Would you be interested?
Thanks,
Kathy
Regards
Rob Irving
Regards
Rob
--
You received this message because you are subscribed to the Google Groups
"IADS" group.
To post to this group, send email to ia...@googlegroups.com.
To unsubscribe from this group, send email to
iads+uns...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/iads?hl=en.
Actually, I have quite a number of work arounds. Of course, this isn't a
final solution, but you could try using the decom function to extract the
ascii and then use sscanf or AtoF function to convert the value:
Decom( BlobParam, ByteOffset, NumBytes, StartBit, StopBit, Type[Int=0
IEEEFloat=1 1750Float=2 Ascii=3 Array=4], Signed, ReverseBytes )
In your case, the function to convert your packed binary into ascii would be
something like this:
Decom( Your64BitParam, 0, 8, 0, 63, 3, FALSE, FALSE )
1) Build a new derived parameter with the above equation
2) Set the ParamType column in the parameter defaults to "ascii"
3) Double check that the source 64 bit parameter is of type "ulong"
(ParamType column again)
4) Once that is complete, save the configuration
5) Drop the new parameter into an alpha.
6) If you see the correct ascii string then skip to step 10
7) If the string looks reversed, try using setting the "ReverseBytes"
argument of the Decom function to TRUE. If that doesn't work quite right,
try to "ByteSwap" function on your source parameters before you feed them
into the Concat16 function. If you get stuck, post your equations.
Once you have the ascii string appearing correctly, create a new derived
equation:
sscanf( "%f", MyNewAsciiParam ) or
AtoF( MyNewAsciiParam )
Set the ParamType column to float, save the config, and drop the new
parameter into a StripChart. Does it work?
BTW, the sscanf function does work... the problem is that there are several
issues with inline function usage. In other words, if the output of the
Decom function is ascii or blob (non numerical), this function does not
work:
sscanf( "%f", Decom(Your64BitParam,0,8,0,63,3,FALSE,FALSE) )
But, If you can extract the ascii into a separate derived parameter and then
feed that derived parameter into the sscanf or AtoF function (as described
above), it will probably be ok. Give it a shot with one parameter and see if
it works ;)
> We contacted ACRA control and they said to use a printf function on
> each Hex Byte to display it representative ASCII character so to
> display 0123.4 you would need 5 seperate alphanumeric displays or
> alternatively develop an active x display to allow the string to be
> displayed.
Actually, using the Alpha's "printf" field (see properties sheet and/or
help), you can combine multiple operations into one statement. Something
like this:
printf( "%c%c%c%c%c%c", (value>>40)&0xFF, (value>>32)&0xFF,
(value>>24)&0xFF, (value>>16)&0xFF, (value>>8)&0xFF, value&0xFF )
Again, this would "display" the value as ascii, but if you wanted to covert
it to a numerical value for use in another equation, you'd have to use the
previous option.
Jim
--------------------------------------------------
From: "Kathy Rodittis" <ka...@iads-soft.com>
Sent: Monday, June 07, 2010 10:38 PM
To: <ia...@googlegroups.com>
Subject: RE: [IADS] GSWorks ASCII Problem
> Our ship based unit transmits an ASCII string that contains wind
> speed data and ship pitch and roll this data is then received by our
> airborne radio modem and sent to the KAM500 UAR-102 (Serial
> Interface). ie wind direction looks like 0123.4 degrees in GSWorks it
> In your case, the function to convert your packed binary into ascii would
> be something like this:
> Decom( Your64BitParam, 0, 8, 0, 63, 3, FALSE, FALSE )
I've actually found a much more cleaner way to do this. Instead of using the
series of Concat functions to build up a 64 bit parameter, I've actually
used the "MakeBlob" function. I'm including an example import AnalysisWindow
(ConfigurationTool->File->Import/Export) that has all of the equations and
some test displays.
MakeBlob( 16, DW1, DW2, DW3 )
Decom( Blob, 0, 6, 0, 6*16, 3, FALSE, FALSE )
Check out the example window for any specifics.
Also, let me correct something from my last post:
> sscanf( "%f", MyNewAsciiParam )
Actually, I goofed up the sscanf equation. It should have been:
sscanf( MyNewAsciiParam, "%lf" )
Notice that I've switched around the arguments... and I've used the "%lf"
(L+F) format. The "%f" format was incorrectly parsing the string. We'll get
this fixed in the next version.
If you guys need this value in a numerical format (vs just viewing it in
string form), we might be able to build you a temporary custom function to
get you past this issue. After you get the new version, you can just dump
the function. It sounds like the next version is going to handle this
automatically anyway.
Jim
> If you guys need this value in a numerical format (vs just viewing it in
> string form), we might be able to build you a temporary custom function to
> get you past this issue. After you get the new version, you can just dump
> the function. It sounds like the next version is going to handle this
> automatically anyway.
I noticed if you change the output type to "float" or "double" of the
derived parameter performing the ascii extraction (I.e. DECOM function),
Iads will automatically convert it to numerical form. No need to sscanf or
atof ;)
Hope this helps. Let me know if you have any other issues,
Jim
Hi Jim,
Thanks so much for your help, we have used the make blob and decom to
achieve the desired result, without your assistance this wouldn't have
happened so thanks again.
Regards
Rob
Robert Irving
Aircraft Maintenance and Flight Trials Unit Avionics Technical Officer
* : 02 44241500
* : robert...@defence.gov.au
-----Original Message-----
From: ia...@googlegroups.com [mailto:ia...@googlegroups.com] On Behalf Of
One more comment:
--
You received this message because you are subscribed to the Google
Groups "IADS" group.
To post to this group, send email to ia...@googlegroups.com.
To unsubscribe from this group, send email to
iads+uns...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/iads?hl=en.
IMPORTANT: This email remains the property of the Department of Defence
and is subject to the jurisdiction of section 70 of the Crimes Act 1914.
If you have received this email in error, you are requested to contact
the sender and delete the email.
--------------------------------------------------
From: "Irving, Robert MR" <Robert...@defence.gov.au>
Sent: Tuesday, June 15, 2010 3:50 PM
To: <ia...@googlegroups.com>
Subject: RE: [IADS] GSWorks ASCII Problem [SEC=UNCLASSIFIED]
You can use the same method as described to Robert in this topic... but just
skip the conversion to floating point. Simply leave the output parameter
type as ascii. Also, since you have 255 characters, you'll need to modify
the "MakeBlob" function to include all of the source parameters.
Just in case you don't have the history, here's a link back to the
beginning. Read the 4th and 5th post. There is even an example window
included:
http://groups.google.com/group/iads/browse_thread/thread/6704f98fd75da667
Once you have the derived parameters built, simply drop them into a
AlphaNumeric or and ActiveX text object (Text property),
Jim
So it's something like this:
BlobParam => MakeBlob( 16, Word1, Word2, ....., Word128 )
AsciiOutputParam => Decom( BlobParam, 0, 255, 0, 255*8, 3, FALSE, FALSE )
Jim
--------------------------------------------------
From: "James Bretz" <j...@iads-soft.com>
Sent: Tuesday, June 22, 2010 9:47 AM
To: "IADS" <ia...@googlegroups.com>
Subject: Re: [IADS] Re: GSWorks ASCII Problem [SEC=UNCLASSIFIED]