Jump to content

new line feed in a string indicator in hex display mode


Madhav

Recommended Posts

I need to display a application log of the data recieved onto the port..the data recieved on the port is in byte array.. so i used byte array to hex sting converter...

i have selected a sting indicator with a hex display...

now the problem is i m unable to add a new line feed...when i concatenate my string (in Hex ) with a new line feed constant it displays 0A (its hex equivalent of the ascii value of new line chracter) on my display....would also like to add up a timestamp..

Does any one know how i can overcome this problem....

Regards,

Madhav.

Link to comment

Hi Madhav

It would help if you posted an example or snippet of you code, but if I understand you problem correctly rather than use concatenate, you should be looking at the "Format into String" function, that way you can build up your output string from a number of different input types, ie hex number / time stamp and also easily put in formating like tab or linefeed.

hope this helps

Dannyt

Link to comment

i use the read port function in Dll using invoke node.. return is byte array i convert it to string concatenate with the input from shift register (prev interation data in log)

and display it on string indicator in hex mode..

what display mode do you have on your log sting ? normal display or "\" code display ...... if you have it set to the code display one then yes you line feed will be seen as you say, it will only appears as a line feed in normal mode. As I said before you should look at the format into string method this will help you build up a log string with timestamp and text and other data types.

Danny

Link to comment

i reached quite close to my target by using the vi used...

but one problem that i m not able to show the complete array in log (string indicator.)

the main prob is the size of constant used during coneversion to decimal..(type cast)

the size of data displayed depends on the size of type that i put i used a I64 format which is the maximum but still it is not enuogh...

Link to comment

Oh sorry

There was a problem attaching the file....

neways i have selected the data type of the constant (0) to be u64...

but still it does not show the entire array in display.. the lenght of the data shown on front panel is dependent on the size of the constant at type cast...

-Madhav

post-18500-0-39516400-1291883843_thumb.j

Link to comment

Thanks a lot for the responses its been great help!!!

But the i have a number of messages coming in from the port (its a read port function tat wod fill the data in the byte array )

Now u have used for loop running 4 times.. so 4 entries..Hope i have analysed it correctly.. :)

i thought of using a while loop in place of for i m having some problems with stopping the loop....

also in the vi posted by U it will collect the data n print it in one go when the loop ends..my requirement is tat i must update log at everytime a message is recieved...

Link to comment

Your reply has left me a little confused, I only put the outer for loop in with a simple hardcoded 4 to show you what the output would look like with several lines in it.

My answer was only meant as a guide to show you one possible way of doing what you want to do and I was leaving you to put it into your solution

How you decide to run you loop generating the data is up to you, it can be a while loop with an exit or whatever you want. If you want to update the output one line at time then just put you string indicator inside the loop.

Danny

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.