Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I write to memory address(8051) using labview?

Hi! I'm new in the Labview world, so I am not sure what I can do or can't do with it yet.


1) I'll like to know if anyone has tried to write to memory locations on an 8051 microprocessor using Labview?

2) I'm using rs232 to receive my data but when I save it on a file all I get is ASCII. If I display
it on an indicator window I have the choice to display it in hex. Do I have the same choice when I save it on to a file?

Thanks to those of you who will take the time to reply.
0 Kudos
Message 1 of 9
(4,473 Views)
Lacver,

1) I've never used a 8051 microprocessor, but the answer to this question really depends on how it is connected to your PC.

2) This KnowledgeBase should answer your second question.

Shawn B.
National Instruments
Use NI products on Linux? Come join the NI Linux Users Community
0 Kudos
Message 2 of 9
(4,445 Views)
Thanks Shawn! I will give it a try and I appreciate you replying.
As for my second problem; I would like to use either serial communication or any best suggestion to try to write/read
the memory on an 8051. Has anything like that being attempted before or am I talking none-sense?

Thanks,

lacver
0 Kudos
Message 3 of 9
(4,441 Views)
Lacver,

If your microprocessor has a serial port you can communicate with that port in LabVIEW, and send it the data it will understand. Since I'm not familiar with the 8051 I'm not sure what kind of data you would have to write/read from your serial port to be able to read or write to its memory.

Basically in LabVIEW you can write/read bytes to your serial port, just like you could with any other programming language, so if it is possible to read and write to your 8051's memory through a serial port you can do it from LabVIEW. You just need to know what kind of data your 8051 is expecting and how it should be formatted.

Shawn B.
National Instruments
Use NI products on Linux? Come join the NI Linux Users Community
0 Kudos
Message 4 of 9
(4,422 Views)


@Lacver wrote:
Hi! I'm new in the Labview world, so I am not sure what I can do or can't do with it yet.


1) I'll like to know if anyone has tried to write to memory locations on an 8051 microprocessor using Labview?

2) I'm using rs232 to receive my data but when I save it on a file all I get is ASCII. If I display
it on an indicator window I have the choice to display it in hex. Do I have the same choice when I save it on to a file?

Thanks to those of you who will take the time to reply.




Certainly! I have written to memory locations on an 8051 using LabVIEW. Generally, I prefer the ASCII type because I can use and and message start and message stop.

The hex display of the string indicator is simply a user interface option that you choose to change. You may save your data as ASCII to a file and then open the file with a binary editor such as BEAV32 or EMACS in hexl-mode and you will see the same interpretation of bytes as the string indicator in hex display or you may open the file with notepad and see the ASCII characters.
Message 5 of 9
(4,412 Views)
Hello Again Shawn,

I think I doing something wrong but adding the node didn't help me at all.
I'm including a .jpg file of what my software looks. As I mentioned before, I have no problems reading the port
is saving my data in hex rather than ASCII where my problem is. I don't want to save it in ASCII since
I need to use those values in a spreadsheet with other Hex values constants.

Thanks
0 Kudos
Message 6 of 9
(4,406 Views)
Odd_modem,

Thanks for replying but can you help me on this since you have a lot of experience in this matter.
I'm very new in the world of programming so I have no clue how is done in any other language. I need to send the
data in hex/binary to the microcontroller to write into memory (I'm sorry if I'm repeating myself) and read the
value in there. The microcontroller I have was inherit to me with the code (did I mention I'm new at programming?).
I was told that it communicates thru the serial port. I got to read from it but unfortunately I couldn't establish
communication with it. One simple command requires 2 bytes and when I try to send it, it just doesn't reply (the microC that is).
Am I sending Ascii?
Is that what the microcontroller is expecting or is it binary/hex?

Thanks for your help and for anyone else who might give me more insight into this.
0 Kudos
Message 7 of 9
(4,405 Views)
Often times each 8051 is unique in the way it communicates. If the code is in 8051 assember then you have to analyse that to understand the communications protocol. Probably, you should have inherited the hardware, the code and a manual that tells you how to talk to it. You might try different baud rate and flow control settings if you think you have a message sequence that will work.
Message 8 of 9
(4,397 Views)
Lacver,

I believe you also have a race condition in your sequence structure...Looks like you have a value being written to a control, and a value being read from that control (via a local variable) in the same sequence frame. You can't know which one will happen first...will the control get the data from the VISA read, or will the local variable's data be "latched" and fed into the "write to file" VI? It is nondeterministic what will happen first, so I would expect that you get some pretty weird data in your file, such as repeating some data and missing other data.

Scott B.
GPIB Software
National Instruments
0 Kudos
Message 9 of 9
(4,388 Views)