GSWorks ASCII Problem

112 views
Skip to first unread message

robert...@defence.gov.au

unread,
Jun 7, 2010, 11:55:53 PM6/7/10
to IADS
Hi
This is my first time here so please be gentle. We are currently using
GSWorks Ver6.3 which I understand is based on IADS our problem is:
1. 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
looks like
DW2 = Hex 3132 = ASCII characters 1 & 2 in 123.4
DW4 = Hex 332E = ASCII Characters 3 & . in 123.4
DW6 = Hex 3409 = ASCII Characters 4 & Tab in 123.4

We then did a CONCAT32 of DW2 & 4 as well as DW6
Then we did a CONCAT64 of all the data words 2,4&6 and ended up with
3132332E3409
but now we need to be able to change the string back to ASCII or a
represenitive figure for 123.4 can this be done in GSworks? or are we
going to struggle?

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. We dont have a software engineer in-house so the Active X
option is out for the moment so any ideas tips help would be greatly
appreciated.

Regards
Rob Irving





Hope this helps and hope there is an answer to our problem.

Regards

Rob

Kathy Rodittis

unread,
Jun 8, 2010, 1:38:52 AM6/8/10
to ia...@googlegroups.com
Hi Rob-

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.

Jim Bretz

unread,
Jun 8, 2010, 2:17:27 PM6/8/10
to ia...@googlegroups.com
Rob,

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

Jim Bretz

unread,
Jun 10, 2010, 5:26:10 PM6/10/10
to ia...@googlegroups.com
Rob,

> 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

Test DecomFunction To Get Ascii.iadsAw

Jim Bretz

unread,
Jun 10, 2010, 7:51:22 PM6/10/10
to ia...@googlegroups.com
One more comment:

> 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

Irving, Robert MR

unread,
Jun 15, 2010, 6:50:26 PM6/15/10
to ia...@googlegroups.com
UNCLASSIFIED


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.

Jim Bretz

unread,
Jun 15, 2010, 7:16:47 PM6/15/10
to ia...@googlegroups.com
Nice! Thanx for the status update ;)
Jim

--------------------------------------------------
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]

vudooman

unread,
Jun 22, 2010, 12:25:51 PM6/22/10
to IADS
Jim,

I too have a similar problem with displaying ASCII. Mine, however, is
really text msg, describing the diagnostic error with the system. How
do you display string of up to 255 characters long in IADS? Is there a
function specific for concatenate ASCII together?

Thanks,

Vu

On Jun 15, 7:16 pm, "Jim Bretz" <j...@iads-soft.com> wrote:
> Nice! Thanx for the status update ;)
> Jim
>
> --------------------------------------------------
> From: "Irving, Robert MR" <Robert.Irv...@defence.gov.au>
> Sent: Tuesday, June 15, 2010 3:50 PM
> To: <ia...@googlegroups.com>
> Subject: RE: [IADS] GSWorks ASCII Problem [SEC=UNCLASSIFIED]
>
>
>
> > UNCLASSIFIED
>
> > 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.irv...@defence.gov.au
> >http://groups.google.com/group/iads?hl=en.- Hide quoted text -
>
> - Show quoted text -

James Bretz

unread,
Jun 22, 2010, 12:47:08 PM6/22/10
to IADS
Hi Vu,

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

Jim Bretz

unread,
Jun 22, 2010, 2:47:35 PM6/22/10
to IADS
Vu,

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]

Reply all
Reply to author
Forward
0 new messages