1
00:00:04,000 --> 00:00:05,000
Hello friends.

2
00:00:05,000 --> 00:00:13,000
Today I will tell you how to read Digital signal using Visa.

3
00:00:14,000 --> 00:00:21,000
In this case I'm using Arduino hardware and one LDR sensor.

4
00:00:22,000 --> 00:00:27,000
It will detect light and according to light it will generate signal.

5
00:00:27,000 --> 00:00:36,000
As you see, when I put my hand over this LDR over here, board module Led goes low, so this is how

6
00:00:36,000 --> 00:00:38,000
it will generate signal.

7
00:00:38,000 --> 00:00:44,000
So right now in this module we have VCC ground and one output pin.

8
00:00:44,000 --> 00:00:50,000
So VCC ground are connected to VCC, connected to the five volt ground is connected to the ground on

9
00:00:50,000 --> 00:00:58,000
board Arduino and this pin output pin is connected to the digital PIN number eight.

10
00:00:58,000 --> 00:01:02,000
So now go to the software part over here.

11
00:01:02,000 --> 00:01:09,000
I have the Arduino code as you see in this, I just use a variable LDR one.

12
00:01:09,000 --> 00:01:20,000
I just connect it or assign a digital pin eight then int variable variable name is one, then void setup

13
00:01:20,000 --> 00:01:25,000
Serial.begin baud rate 9.600 Pinmode.

14
00:01:25,000 --> 00:01:33,000
In this case the pin is LDR one and the pin mode is input then void loop.

15
00:01:33,000 --> 00:01:38,000
Then over here I just go to the variable.

16
00:01:38,000 --> 00:01:40,000
It will still read.

17
00:01:41,000 --> 00:01:43,000
And read from one.

18
00:01:43,000 --> 00:01:51,000
If variable one is high when it is high, it will print serial write a.

19
00:01:52,000 --> 00:01:54,000
Else it right be okay.

20
00:01:54,000 --> 00:01:56,000
So this is the code for Arduino.

21
00:01:56,000 --> 00:02:05,000
Now just burn this code into the Arduino, select your Arduino board, then select your port.

22
00:02:06,000 --> 00:02:10,000
My com port eight is there now just run it.

23
00:02:11,000 --> 00:02:15,000
Directly click on upload.

24
00:02:16,000 --> 00:02:17,000
Uploading is done.

25
00:02:18,000 --> 00:02:20,000
So now I just close this.

26
00:02:20,000 --> 00:02:30,000
I just go to the LabVIEW code Over here in this lab code, there is some change from my previous lecture.

27
00:02:30,000 --> 00:02:33,000
As you see over here, I have Visa configure serial port.

28
00:02:33,000 --> 00:02:40,000
You can find this one in serial configure port over here.

29
00:02:40,000 --> 00:02:43,000
This is the serial configure port.

30
00:02:43,000 --> 00:02:48,000
Then you just need to convert bytes to port bytes at port.

31
00:02:50,000 --> 00:02:55,000
So again, you just go to the serial over here bytes at serial port.

32
00:02:55,000 --> 00:02:58,000
It will read bytes at serial port.

33
00:02:58,000 --> 00:03:01,000
So you need to just drag and drop this.

34
00:03:01,000 --> 00:03:06,000
Just make its label visible.

35
00:03:08,000 --> 00:03:09,000
It is my property node.

36
00:03:10,000 --> 00:03:12,000
Then over here, this is my visa.

37
00:03:12,000 --> 00:03:14,000
You just need to connect.

38
00:03:15,000 --> 00:03:21,000
Source to source error into error out and over here byte port to the visa read.

39
00:03:21,000 --> 00:03:24,000
In this case I'm just using visa read function.

40
00:03:24,000 --> 00:03:26,000
I just label it.

41
00:03:26,000 --> 00:03:32,000
I just make it large for you so that it is readable.

42
00:03:33,000 --> 00:03:35,000
Control you.

43
00:03:37,000 --> 00:03:40,000
So as you see over here.

44
00:03:41,000 --> 00:03:46,000
So it will read my bytes available at the given port.

45
00:03:46,000 --> 00:03:47,000
Over here.

46
00:03:47,000 --> 00:03:50,000
I'm just using delay of 10s.

47
00:03:50,000 --> 00:03:52,000
If you are not using this, I just show you.

48
00:03:52,000 --> 00:03:53,000
What happened.

49
00:03:54,000 --> 00:03:59,000
So over here, this function is my string length subset.

50
00:03:59,000 --> 00:03:59,000
String.

51
00:04:02,000 --> 00:04:05,000
So over here, I got the different values.

52
00:04:05,000 --> 00:04:07,000
A series of values.

53
00:04:07,000 --> 00:04:09,000
And I want just only one value.

54
00:04:09,000 --> 00:04:15,000
When this value is equal to a, it will turn on my l d r.

55
00:04:15,000 --> 00:04:17,000
Okay, then close.

56
00:04:17,000 --> 00:04:19,000
Okay, so this is my function.

57
00:04:20,000 --> 00:04:24,000
So now I just hit on run button.

58
00:04:24,000 --> 00:04:26,000
Let's see what happened.

59
00:04:27,000 --> 00:04:31,000
So before it you just need to set your port also.

60
00:04:34,000 --> 00:04:37,000
Or here in the visa resource name.

61
00:04:42,000 --> 00:04:44,000
The port is on port eight.

62
00:04:45,000 --> 00:04:46,000
I hit on run button.

63
00:04:47,000 --> 00:04:59,000
As you see, our hair comes directly When I just put my hand a finger over LDR, it will generate a

64
00:04:59,000 --> 00:05:00,000
Led goes high.

65
00:05:03,000 --> 00:05:08,000
So this is how it will read serial signals.

66
00:05:09,000 --> 00:05:11,000
Okay, Using Visa.

67
00:05:11,000 --> 00:05:12,000
Now, just stop it.

68
00:05:13,000 --> 00:05:18,000
In this case, when I just remove this one, let's check what happened.

69
00:05:19,000 --> 00:05:20,000
I again hit on run button.

70
00:05:22,000 --> 00:05:25,000
Signal is changing, but it is not showing.

71
00:05:25,000 --> 00:05:27,000
It is very fast.

72
00:05:27,000 --> 00:05:28,000
Okay.

73
00:05:28,000 --> 00:05:33,000
So it is not visible for bear eyes to check what happened.

74
00:05:33,000 --> 00:05:37,000
But in between LDR goes high for some seconds.

75
00:05:37,000 --> 00:05:44,000
So in this case I just again bring my delay.

76
00:05:45,000 --> 00:05:46,000
It is ten milliseconds.

77
00:05:46,000 --> 00:05:47,000
Okay.

78
00:05:47,000 --> 00:05:55,000
And if you want to also check what is the output of this substring, I just create control over here,

79
00:05:57,000 --> 00:05:59,000
not control indicator over here.

80
00:06:00,000 --> 00:06:01,000
It will generate signal for me.

81
00:06:02,000 --> 00:06:05,000
Over here I get a series of data like Bvb.

82
00:06:05,000 --> 00:06:09,000
And over here I just only one data because my length is one string.

83
00:06:09,000 --> 00:06:10,000
Subset length is one.

84
00:06:11,000 --> 00:06:12,000
So when I hit on run button.

85
00:06:14,000 --> 00:06:15,000
As you see over here.

86
00:06:15,000 --> 00:06:22,000
I got B when I just put my hand, I got a and my head goes high.

87
00:06:22,000 --> 00:06:32,000
So this is how you can read digital signals using visa with the help of or you can interface any signal

88
00:06:32,000 --> 00:06:42,000
or any sensor with your Arduino or any hardware device and you configure your LabVIEW using Visa to

89
00:06:42,000 --> 00:06:44,000
read this serial signal.

90
00:06:44,000 --> 00:06:46,000
So this is all about today's lecture.

91
00:06:46,000 --> 00:06:47,000
Thank you.

