-
To convert the data, you must first understand the data structure of integer int, time s5time and time. The integer int is 16-bit data:
Time S5Time is 16-bit data, BCD code format:
<> time is 32-bit data, similar to the two-integer dint:
It can be seen that the conversion between the three is the conversion between integer int, double integer dint and bcd code. According to the characteristics of the data structure, you can program yourself to realize the mutual conversion, which is more complicated. Using the library function fc33 fc40 is the easiest and most convenient.
Here's how:1The integer int to the time s5time conversion method:
int ->i di, ->dint, ->move, ->time, -> library function, fc40 ->s5time.
<>2.The conversion method of integer int to time is as follows: int ->i di instruction ->dint ->move instruction ->time. As illustrated
<>3.Time s5time to integer int conversion method:
s5time -> library function fc33 ->time ->movedirective ->dint -> to take the high-letter part and use the move directive ->int.
-
1. First, create a new html file and name it.
2. In the file, use new date() to get the current time and save it in the date variable.
3. In the file, use getfullyear() to get the year of the current time, and the year is a four-digit year.
4. In the file, use getmonth() to get the month of the current time, and the month obtained by this method is a number from 0 to 11, so you need to add 1.
5. In the file, use getdate() to get the day of the current time, and the result is the number from 1 to 31.
6. In the file, use gethours() to get the hours of the current time, and the result is a number from 0 to 23.
7. Finally, open the page in the browser and view the execution result.
-
If so: S7 can be converted to S5Time data type:
1.After writing the data store of PLC, the value is converted into a double integer with ITD (integer to double integer) or RND (real to double integer with rounding off), and then the value is written into a variable of type time. Call fc40 in the program and convert time to s5time.
2.After writing the PLC data storage area, use the WOR W command under Word Logic to compare the value with the time base or the time base, and then use the move command to write the obtained value into a variable of the S5Time type.
3.If you use wincc as the upper-bit software, or the upper-bit software supports 32-bit signed floating-point numbers, you can write 32-bit signed floating-point numbers from the upperside to the variables defined as time in the plc, and then call fc40 in the program to convert time to s5time.
FC33 is used for s5time to time conversion. FC40 uses the conversion of the eldest grandson to the time to s5time. These two blocks are located in the Libraries Standard Library IEC Function Blocks path, and the description of the function blocks is described in the ** Help.
2) Integer part: The 2 (x) that appears below indicates the meaning of 2 to the x power. >>>More
Copy all in word, go to execl to create an empty table, right-click, paste selectively, select text, and you can copy the content in word** as it is. >>>More
Format cells – custom: as shown below.
Click OK to see the results! >>>More
Software Name: Batch Conversion Expert supports TXT, FOXPRO, GIF, ICO >>>More
Convert the local path to a URL-relative path.
private string urlconvertor(string imagesurl1) >>>More