Madhav Posted December 8, 2010 Report Share Posted December 8, 2010 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. Quote Link to comment
dannyt Posted December 8, 2010 Report Share Posted December 8, 2010 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 Quote Link to comment
Madhav Posted December 8, 2010 Author Report Share Posted December 8, 2010 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.. Quote Link to comment
dannyt Posted December 8, 2010 Report Share Posted December 8, 2010 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 Quote Link to comment
Madhav Posted December 9, 2010 Author Report Share Posted December 9, 2010 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... Quote Link to comment
Ton Plomp Posted December 9, 2010 Report Share Posted December 9, 2010 i reached quite close to my target by using the vi used... Could you post that VI? I only see a screenshot of some code, but there is no typecast in that piece of code. Ton Quote Link to comment
Madhav Posted December 9, 2010 Author Report Share Posted December 9, 2010 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 Quote Link to comment
dannyt Posted December 9, 2010 Report Share Posted December 9, 2010 This may not be the most efficient way but it does work and allows quite a bit of flexibility in you log sting 1 Quote Link to comment
Madhav Posted December 10, 2010 Author Report Share Posted December 10, 2010 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... Quote Link to comment
dannyt Posted December 11, 2010 Report Share Posted December 11, 2010 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.