08-09-2013 08:28 AM - edited 08-09-2013 08:36 AM
I have in 2 different traffic generators the input of source and destination address.
I need to read from a .txt file the desired addresses and then configure the generators. I want that the typed address in the .txt file will be in the same format as you can view in the generator interface (thats what I cant change)
The problem is that each one of them is using different arrays formats as input to the function, and I would like to read from the .txt file as a string.
For the first one at the moment I am doing like this:
and as I result, and is right, I have the array 0-0-0-0-0-3:
For the second one, when I type directly into the generator the address 00-00-00-00-00-22 , I will get on Labview an array 0-0-0-0-0-34, that I am converting to number as below:
as a result:
So, how can I convert , that will be typed in the .txt file, into the array above?
Thanks and I hope to be possible to understand what I need 🙂
Solved! Go to Solution.
08-09-2013 08:34 AM - edited 08-09-2013 08:35 AM
If you attach your code, we can understand better what you mean. At the moment, your problem is unclear.
Cameron
Wow! fast service...
08-09-2013 08:39 AM
are you sure? I was thinking that would be more confusing my code 🙂
Here we go.
String to array works fine for the first generator.
Pase packet is for the second one. Where you maybe can see the format of the desired address.
08-09-2013 08:43 AM
in Parse Packet:
"data" comes from the analisys of the traffic generator
"dst address" and "src address" comes from the .txt file.
I need to compare them and they need to be the same. But the difference of formats is not allowing this.
08-09-2013 09:10 AM - edited 08-09-2013 09:30 AM
***EDITED***
Oh sorry. I didn't read properly. I'll make a modification here
08-09-2013 09:40 AM
I cant follow the code logic for the Parse Packet VI (so no help there) but thought I could shorten the string to array VI...
While there is nothing wrong with it, I thought it was a little long for the conversion you were doing.
08-09-2013 10:57 AM
sorry but is not like this yet. this returns me an array 000000000022.
In my input I have 34 as shown above. This comparison still is different.
08-09-2013 10:59 AM
OK, so see if I understand you correctly.
What you want to do is take the 12-digit MAC address strings (that you have already pulled from your .txt file) and convert them into 6-member numerical arrays?
If so, this will do that (once for each MAC address):
Now, there may be (probably are) other ways, and this may not be (probably isn't) the most efficient way to do it, but it will work.
TIMTOWTDI.
Cameron
08-12-2013 06:15 AM
thanks!!
it works fine 🙂
08-12-2013 06:44 AM - edited 08-12-2013 06:47 AM