LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending text (ASCII) as binary code. Beginner.

Hello there LV-gurus.

 

My mission is basically being able to send information one bit at a time and since I have no background knowledge it is a tedious process figuring out how to do so. I'm not asking for complete solutions considering I want to actually learn it, but I am hoping I could get some pointers on what I should read up on or how to make this happen.

 

At my disposal I have a DAQmx, from which I hope to send binary information (or a digital wave) regulating a component that will basically just pass this information on to another (actually the same for now) DAQmx where I want to decode it back.

 

What I'm trying to do, but failing to understand how, is more or less this;

 

Convert ASCII to binary/digital wave. Here I've tried using the string to byte array but I'm having trouble to finding a way to use the values I get in the byte array.

 

How to incorporate a "start/stop listening" signal before/after sending the information.

 

I'm certain there is whole bunch of functions/procedures/whatnots I'm completely missing, so any help or friendly nudges in the right direction is much appriciated. My feeble attempts to scan through the plethora of instructions, help texts and posts relating to this matter has left me stumped.

 

 

0 Kudos
Message 1 of 8
(2,889 Views)

You cannot send data one bit at a time. The smallest datatype have units of bytes (8 bits). even a boolean takes up 8 bits.

 

I don't understand the rest of your post. What do you mean by "send". What is the transport mechanism (within the same VI, over ethernet, etc.)? Why do you need to start/stop listening? Who is the master?

0 Kudos
Message 2 of 8
(2,876 Views)

In this case "send" will essentially be regulating the voltage to a component enabling a light source reaching a photosensitive cell.

 

I was thinking that the only way I can do this is by decoding whatever information I want to send to binary and sending these "on or off" signals as a square wave.  Then my idea was that I needed a start/stop listening "signal" to tell the reciever the message is complete. Doing this within the same VI would be a start, but the end goal is open air commuication between two devices.

 

Thanks for helping btw.

0 Kudos
Message 3 of 8
(2,853 Views)
You need to provide some details on this component of yours. You also need to understand that DAQmx is software and saying that you have one or two of these makes little sense.
0 Kudos
Message 4 of 8
(2,834 Views)

Oh, you are right, that makes no sense. The component I was calling a DAQmx is a NI USB-6003. In my mind used to basically turn on or off the light source and on the other end to recieve the information sent.

0 Kudos
Message 5 of 8
(2,827 Views)

How fast did you want to toggle your digital line?  The 6003 only has software timed digital outputs, so it will be putting the data out really slowly.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 8
(2,819 Views)

I have to make some research on that, but the goal is to reach the maximum capacity of my components. I thought I could output a square wave through the analog output..

0 Kudos
Message 7 of 8
(2,810 Views)

So is this going to be continuos transmission of a stream of bits that emulate a maintained connection or bursts of data transmission followed by long periods of zeros? Square wave is not really going to be helpful for transmitting data considering the effort required to start/restart/stop the square wave would cause significant slow down, especially if you want to transmit real data and not just varying frequency square waves. 

 

You should simply be able to start off converting your data into a digital waveform then passing that data through a DAQmx Write command (Digital Wfm>1 Chan>1 Samp).

Assuming you want to be able to read this information as well you can simply read the data using a DAQmx Read command configured similarly to compare the output and inputs.

 

For most of your data configuration set up you will want to have a look around the Waveform -> Digital Wfm

The conversion menu should hold some VIs of interest regarding generating the waveform data.

 

For the data transmission I would say looking at the "Digital - SW - Timed Output.vi" in the example finder would help a lot.

(Example finder is found under Help -> Find Examples)

0 Kudos
Message 8 of 8
(2,778 Views)