1
00:00:05,000 --> 00:00:06,000
Hello, friends.

2
00:00:06,000 --> 00:00:17,000
Today I will tell you how to acquire and how to generate C datas using serial communication with the

3
00:00:17,000 --> 00:00:19,000
help of visa in late.

4
00:00:20,000 --> 00:00:30,000
For that purpose I just create the codes as you see over here in my previous videos, as you see over

5
00:00:30,000 --> 00:00:41,000
here in this case I just writing two datas or to write this data over here, I just use a select button

6
00:00:41,000 --> 00:00:51,000
and this select button will send a signal A or D if A is there according to that, it will turn on my

7
00:00:51,000 --> 00:00:54,000
one and this is my two.

8
00:00:54,000 --> 00:01:00,000
And if p signal goes from here, it will turn on led B on the hardware.

9
00:01:00,000 --> 00:01:07,000
As you see over here, I have two elders for input and two LEDs for output.

10
00:01:07,000 --> 00:01:16,000
So this will generate data for my Arduino and Arduino will generate data for these two LEDs.

11
00:01:16,000 --> 00:01:22,000
As you see over here, this one, one green and this one yellow.

12
00:01:22,000 --> 00:01:30,000
And these two LEDs are connected to the PIN number four and five, and the input are connected to eight

13
00:01:30,000 --> 00:01:32,000
and nine digital pin.

14
00:01:32,000 --> 00:01:33,000
Okay.

15
00:01:33,000 --> 00:01:35,000
So just go to the Arduino code.

16
00:01:35,000 --> 00:01:37,000
I will explain you.

17
00:01:37,000 --> 00:01:44,000
So over here I just first configure or assign variable to one led to fifth and fourth.

18
00:01:44,000 --> 00:01:46,000
These are my input pin.

19
00:01:48,000 --> 00:01:49,000
These are my output.

20
00:01:49,000 --> 00:01:51,000
Okay then LDR one.

21
00:01:51,000 --> 00:01:52,000
LDR two.

22
00:01:53,000 --> 00:01:55,000
These are my input pin.

23
00:01:55,000 --> 00:01:57,000
These are from LDR.

24
00:01:57,000 --> 00:02:00,000
Then I have variable.

25
00:02:00,000 --> 00:02:07,000
We are for the output and VR1 and VR2 for input.

26
00:02:07,000 --> 00:02:08,000
Okay.

27
00:02:08,000 --> 00:02:15,000
Then you have to set the pin mode led one led to output LDR one ldr two as a input.

28
00:02:16,000 --> 00:02:18,000
After this, go to the void loop.

29
00:02:19,000 --> 00:02:22,000
I also share this code in my video.

30
00:02:23,000 --> 00:02:34,000
So over here you have to just read serially read the data from the LabVIEW because LabVIEW will generate

31
00:02:34,000 --> 00:02:43,000
a or B signal to turn on Led 1 or 2 or here, if it is equal to A it will turn on Led one.

32
00:02:43,000 --> 00:02:47,000
If it is equal to B, it will turn on led to.

33
00:02:47,000 --> 00:02:50,000
And these are controlled using two different switches.

34
00:02:51,000 --> 00:02:52,000
After this.

35
00:02:52,000 --> 00:02:53,000
Over here.

36
00:02:53,000 --> 00:02:57,000
This is the code for the digital read.

37
00:02:57,000 --> 00:02:59,000
So variable one.

38
00:02:59,000 --> 00:03:08,000
It will read data from LDR one It will read data from LDR two and if variable one is high, it will

39
00:03:08,000 --> 00:03:14,000
send the data to the indexing zero.

40
00:03:14,000 --> 00:03:24,000
See else it will send D and if more character two is high, it will send the character to the indexing

41
00:03:24,000 --> 00:03:33,000
one e otherwise it will send D and just print serial data in line form.

42
00:03:34,000 --> 00:03:43,000
So over here and initially also over here, as you see, I characterize this character as the size of

43
00:03:43,000 --> 00:03:43,000
this.

44
00:03:44,000 --> 00:03:48,000
Or you can say the length of this is to 0 or 1.

45
00:03:48,000 --> 00:03:48,000
Okay?

46
00:03:48,000 --> 00:03:58,000
So you just need to run this code or upload this code into the Arduino board right now.

47
00:03:58,000 --> 00:04:03,000
Arduino The code is uploaded properly.

48
00:04:03,000 --> 00:04:07,000
Now just go to the LabVIEW code over here.

49
00:04:07,000 --> 00:04:11,000
I just combined my two codes.

50
00:04:11,000 --> 00:04:16,000
First one over here it is for Digitalwrite, for the LEDs.

51
00:04:16,000 --> 00:04:23,000
And over here I got the read function from the elders.

52
00:04:23,000 --> 00:04:27,000
Okay, so now you have to just set the comport over here.

53
00:04:27,000 --> 00:04:32,000
So these two will generate signal for different two LEDs.

54
00:04:32,000 --> 00:04:40,000
And over here I got the serial data as you see that is available using visa read over here.

55
00:04:40,000 --> 00:04:42,000
And I just split these signals.

56
00:04:42,000 --> 00:04:46,000
As you see from here, I got zero indexing.

57
00:04:46,000 --> 00:04:53,000
When it is equal to C, it will turn on my Led and when it is equal to E, it will turn on led to that

58
00:04:53,000 --> 00:04:55,000
is available over here.

59
00:04:55,000 --> 00:05:03,000
So right now I just run it as you see right now data is read and I just split it.

60
00:05:03,000 --> 00:05:07,000
So LDR one is off because it is not equal to C LDR two.

61
00:05:07,000 --> 00:05:19,000
It is also because it is not equal to E, So I just place my hand or finger over the LDR so as you see

62
00:05:19,000 --> 00:05:28,000
it will turn on because it is equal to E and when I just put my hand over the LDR one.

63
00:05:30,000 --> 00:05:35,000
It takes some time because it also store the data as you see right now.

64
00:05:35,000 --> 00:05:40,000
So this is how you can read the signals.

65
00:05:40,000 --> 00:05:46,000
And now I just want to upload right data.

66
00:05:46,000 --> 00:05:48,000
So first I turn on this.

67
00:05:48,000 --> 00:05:55,000
As you see Led goes high off it, then turn on this led goes high.

68
00:05:56,000 --> 00:06:00,000
The flickering is because of this time delay.

69
00:06:00,000 --> 00:06:06,000
So this is how if you want to on both the LEDs, this is how you can control.

70
00:06:06,000 --> 00:06:14,000
So this is the code for visa write and read process serially.

71
00:06:14,000 --> 00:06:16,000
So this is all about today's lecture.

72
00:06:16,000 --> 00:06:17,000
Thank you.

